open.mp forum
[Pawn] How to use OnGameModeExit? - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] How to use OnGameModeExit? (/showthread.php?tid=432)



How to use OnGameModeExit? - Luciano - 2019-04-22

Should I do the following things in OnGameModeExit or they are done automatically in the background?



- close files

- close database connections

- save player data (despite doing so in OnPlayerDisconnect)

- destroy global textdraws

- destroy gvars

- destroy gangzones or dynamic areas/pickups/checkpoints/actors





Is there any other action that I'm supposed to do in OnGameModeExit?


RE: How to use OnGameModeExit? - kristo - 2019-04-22

Most of these things are only necessary if your server is running multiple gamemodes that can be switched between, which is very uncommon and usually when the gamemode exits, it means that the server is being closed and the things you listed are being destroyed anyway, because the server instance just doesn't exist anymore after that. However if you want to be super correct and sure, you can do all of these things.


RE: How to use OnGameModeExit? - Y_Less - 2019-04-22

Files definitely yes.


RE: How to use OnGameModeExit? - Gravityfalls - 2019-04-22

If you use Streamer, it automatically deletes those stuff for you when it detects OnGameModeExit is called.


RE: How to use OnGameModeExit? - Carlos - 2019-04-23

No reason not to do the first three.


RE: How to use OnGameModeExit? - Woozie_Cross - 2019-04-23

files do