• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] How to use OnGameModeExit?
#1
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?
  Reply
#2
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.
  Reply
#3
Files definitely yes.
  Reply
#4
If you use Streamer, it automatically deletes those stuff for you when it detects OnGameModeExit is called.
  Reply
#5
No reason not to do the first three.
  Reply
#6
files do
  Reply


Forum Jump: