OnPlayerDisconnect.
#1

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

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

If my answer helped you, could you please +rep me?
If you have any other questions regarding the savegame system please let me know

Thanks in advance,
Reply
#4

Yes, it's called.
If you play in a RP server (GF edit), crash and reconnect. You'll see what happenes.
Well, player crashes, OnPlayerDisconnect is called and a variable is set to 1 and saved. When he reconnect he'll spawn where he crashed and the variable is set to 0.

Best regards!
Reply
#5

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


Forum Jump:


Users browsing this thread: 1 Guest(s)