Does A GameModeExit Variable affect next start?
#1

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?
Reply
#2

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.
Reply
#3

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.
Reply
#4

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).
Reply
#5

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
Reply
#6

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!
Reply
#7

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

Thanks everyone, solved
EDIT: Vince, yeahyou are right
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)