25.09.2016, 23:15
Quote:
No, OnPlayerDisconnect doesn't get called untill SMAP finds out that player is timed out,
When a player times out, it freezes into the state that player was, server will find out about it, maybe 30 sec to 1 min later. Saving players stat every 1 min is a bad idea, make that every 10 minutes and also save when user is disconnecting. You should not be worried about players timing out, they will be saved eventually after disconnecting. Also try debugging your code, debug variables and check out mysql errors (set error reporting). I hope that was helpful. |
The player is still connected during that "freeze" state. There should be no issue there.
--------------------------------------------------
Change "playerid != INVALID_PLAYER_ID" for "IsPlayerConnected(playerid)" in "stock SavePlayerData(playerid)".
I don't see how you're getting the value of "TotalTime[playerid]", use timestamp(s) in combination with that variable if you aren't already.
Kill player-related timers on disconnect. Use a global timer. You could also change "LoggedIn[playerid] == 1" for "LoggedIn[playerid]".