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)
Im not sure if it works, but its in the wiki:
That doesn't seem to be implemented yet, it isn't in the startup.lua file. Also, I think it is supposed to be used by the server to that a server-side script can decide who wins, useful for mods like soccer where you would like the winner to be determined by if the shooter scores a goal or not (at the moment an admin has to manually /spec the loser).
the startup file is for hooks, this is a function.
And yes it is supposed to be a server side thingy, but so is end_game.
Also its /fspec for server admins :P