Im not sure if it works, but its in the
wiki:
check_winner- Called at the end of every frame to check for a winner
- To signify that no condition was met, the callback should not return a value, or return 0 or nil
- To signify that the game was won, the callback should return a table of the following values:
- end_type: the type of winning condition (affects display on clients); can be one of the following: END_TYPE.END_SCORE, END_TYPE.END_DRAW, END_TYPE.END_DQ
- winners: the index of the winner (0 for RED, 1 for BLUE)
- losers: the index of the loser (0 for RED, 1 for BLUE)