Posts: 526
Threads: 59
Joined: Feb 2011
Reputation:
0
Hey there!
I have a question about OnPlayerDisconnect.
If a player crashes, does the OnPlayerDisconnect get called? So i have a saving system, should i just put the saving files under OnPlayerDisconnect and OnGamemodeExit, or just leave it on a timer?
Posts: 47
Threads: 4
Joined: Jul 2009
Reputation:
0
Hi,
I use my own function called SaveGame(playerid); on OnPlayerDisconnect
and when something important had happend to the player (death, got an achievement etc)
We've created allot of unlockables in our GM so we save when the player obtains one, this is just
to prevent dataloss in a rare case that the server crashes, normaly they only save on my server using
OnPlayerDisconnect()
And this works fine in our case.
[Edited Post because of Crappy english :P]
Posts: 318
Threads: 31
Joined: Mar 2012
Reputation:
0
If it's player-related, you really have to save data under OnPlayerDisconnect(), and for all the other stuff which needs saving, put them under OnGameModeExit() although, it's best to save a player's data on both, so whenever the game-mode exits or restarts, you have the assurance that they've been saved.