OnGameModeExit
From SA-MP Wiki
(Difference between revisions)
Revision as of 17:31, 18 April 2015 MP2 (Talk | contribs) ← Previous diff |
Revision as of 13:28, 20 August 2016 Vince (Talk | contribs) Next diff → |
||
Line 7: | Line 7: | ||
{{NoReturnCallback}} | {{NoReturnCallback}} | ||
- | {{note|This function can also be used in a filterscript to detect if the gamemode changes with [[RCON#RCON_Commands|RCON commands]] like changemode or gmx, as changing the gamemode does not reload a filterscript.}} | + | {{notes| |
- | + | *This function can also be used in a filterscript to detect if the gamemode changes with [[RCON#RCON_Commands|RCON commands]] like changemode or gmx, as changing the gamemode does not reload a filterscript. | |
- | {{note|When using OnGameModeExit() in conjunction with the 'rcon gmx' console command keep in mind there is a potential for client bugs to occur an example of this is excessive RemoveBuildingForPlayer() calls during OnGameModeInit() which could result in a client crash.}} | + | *When using OnGameModeExit() in conjunction with the 'rcon gmx' console command keep in mind there is a potential for client bugs to occur an example of this is excessive RemoveBuildingForPlayer() calls during OnGameModeInit() which could result in a client crash. |
+ | *This callback will NOT be called if the server crashes or the process is killed by other means, such as using the Linux kill command or pressing the close-button on the Windows console. | ||
+ | }} | ||
{{Example}} | {{Example}} |
Revision as of 13:28, 20 August 2016
Description:
This callback is called when a gamemode ends, either through 'gmx', the server being shut down, or GameModeExit.
This callback has no parameters.
Return Values:
This callback does not handle returns.
Notes |
|
Example Usage:
public OnGameModeExit() { print("Gamemode ended."); return 1; }
Related Callbacks
The following callbacks might be useful as well, as they are related to this callback in one way or another.
- OnGameModeInit: Called when a gamemode starts.
- OnFilterScriptExit: Called when a filterscript is unloaded.
- OnFilterScriptInit: Called when a filterscript is loaded.
Related Functions
The following functions might be useful, as they're related to this callback in one way or another.
- GameModeExit: Exit the current gamemode.