OnGameModeExit
The server shuts down or the mode is about to be reloaded.
The last callback of a mode’s life; the objects the mode made are torn down by the server right after this. A write to
the mode’s database from here (Execute) still goes out, but on a shutdown the server may be gone before
it lands: keep the writes that matter at the moment of the change and on the disconnect, not here.
Syntax
Section titled “Syntax”function OnGameModeExit() -- ...endReturns
Section titled “Returns”nothing
Example
Section titled “Example”function OnGameModeExit() if db then db:Execute("UPDATE server_stats SET rounds = @r WHERE id = 1", { r = roundsPlayed }) endendSee also
Section titled “See also”OnGameModeInit · ReloadGameMode · the Server and timers group of the index
