SA-MP Forums Archive
Does A GameModeExit Variable affect next start? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Does A GameModeExit Variable affect next start? (/showthread.php?tid=518485)



Does A GameModeExit Variable affect next start? - Battlezone - 10.06.2014

Hi, if I had this varible

pawn Код:
Captured[playerid][zoneid] = 1
And I close the server, without putting anything OnGameModeExit to make the variable 0 , will it be 1 on next start?
& what about the restart?


Re: Does A GameModeExit Variable affect next start? - Scrillex - 10.06.2014

It depends if you are saving it or not.... Basically you can set it under OnPlayerDisconnect to 0.

If you ain't saving it then it is affective to it.. So when you restart the server as new yourvariable [MAX_PLAYERS];

It will automatically set it to 0 on restart.


Re: Does A GameModeExit Variable affect next start? - Beckett - 10.06.2014

Nope, it wont stay (1) because the gamemode exit which means all variables will be set to 0.

Quote:
Originally Posted by Scrillex
Посмотреть сообщение
It depends if you are saving it or not.... Basically you can set it under OnPlayerDisconnect to 0.
OnPlayerDisconnect has nothing to do with GameModeExit.


Re: Does A GameModeExit Variable affect next start? - Scrillex - 10.06.2014

Read my post after edit Just didn't say it clearly.. But if he is saving the data OnGameModeExit or OnPlayerDisconnect it will save it (mysql or y_ini, dini - or what ever).


Re: Does A GameModeExit Variable affect next start? - Battlezone - 10.06.2014

I see many people setting their variables back to 0 on OnGameModeExit, why?
EDIT: Even though they don't need to save them, they set them back to 0, i saw that in many gms posted in samp forums


Re: Does A GameModeExit Variable affect next start? - Scrillex - 10.06.2014

Because when server is restarted or anything happens to the server like crash it will set everything to 0.... Basically it works like that. It depends on the system what you are using.. Same as your server crashes and you aint saving files under OnGameModeExit you will loose player latest data... That's why they are saving or setting variables to 0..

You can read about this just for more info what is happening when you are using OnGameModeExit

HERE IS A LINK!


Re: Does A GameModeExit Variable affect next start? - Vince - 10.06.2014

Ignorance, perhaps. However, I do think OnGameModeInit/OnGameModeExit are properly called in a filterscript. Filterscripts aren't unloaded during a gmx/changemode.


Re: Does A GameModeExit Variable affect next start? - Battlezone - 10.06.2014

Thanks everyone, solved
EDIT: Vince, yeahyou are right