Player stats sometimes not saving.
#10

Quote:
Originally Posted by amirm3hdi
View Post
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.
That's complete non-sense, it doesn't take that long. Even if it did take that long, variables holding player statistics should/are only reset at the end of the player's disconnection, or after stats were saved.

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


Messages In This Thread
Player stats sometimes not saving. - by Dokins - 25.09.2016, 20:27
Re: Player stats sometimes not saving. - by PrO.GameR - 25.09.2016, 20:42
Re: Player stats sometimes not saving. - by Dokins - 25.09.2016, 20:55
Re: Player stats sometimes not saving. - by Shinja - 25.09.2016, 21:15
Re: Player stats sometimes not saving. - by Dokins - 25.09.2016, 21:22
Re: Player stats sometimes not saving. - by SickAttack - 25.09.2016, 21:32
Re: Player stats sometimes not saving. - by amirm3hdi - 25.09.2016, 21:45
Re: Player stats sometimes not saving. - by Dokins - 25.09.2016, 22:40
Re: Player stats sometimes not saving. - by Shinja - 25.09.2016, 23:11
Re: Player stats sometimes not saving. - by SickAttack - 25.09.2016, 23:15

Forum Jump:


Users browsing this thread: 1 Guest(s)