SA-MP Forums Archive
Player data becomes corrupt after manual server restart - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Player data becomes corrupt after manual server restart (/showthread.php?tid=512526)



Player data becomes corrupt after manual server restart - AndySedeyn - 11.05.2014

I don't know whether this is correctly posted or not but I have this problem that whenever I restart my test server manually while the player is logged on, the player's data becomes corrupt. (Skin changes to 0, spawn place becomes blueberry,...)

Is there a fix for this problem? It concerns me for when my test server crashes randomly that all the data becomes corrupt.

I added this to OnGameModeExit();
pawn Код:
public OnGameModeExit()
{
    foreach(new i : Player)
    {
        if(IsPlayerConnected(i))
        {
            if(fexist(UserPath(i)))
            {
                SaveAccountInfo(i);
            }
        }
    }
    return 1;
}
Help is much appreciated.


Re: Player data becomes corrupt after manual server restart - Beckett - 11.05.2014

Don't use /rcon GMX, use an ingame command and make a timer of 3-5 seconds to save every data of a player then restart the server.


Re: Player data becomes corrupt after manual server restart - AndySedeyn - 11.05.2014

Quote:
Originally Posted by DaniceMcHarley
Посмотреть сообщение
Don't use /rcon GMX, use an ingame command and make a timer of 3-5 seconds to save every data of a player then restart the server.
I have an ingame command /gmx and I did make a timer for it.
But the thing I am concerned about is: if the server crashes for some reason for example the host has problems, will it corrupt player data? Or not?


Re: Player data becomes corrupt after manual server restart - Beckett - 11.05.2014

How are you saving the data each one second(Timer) or OnPlayerDisconnect?


Re: Player data becomes corrupt after manual server restart - AndySedeyn - 11.05.2014

I'm saving it under OnPlayerDisconnect and OnGameModeExit.


Re : Player data becomes corrupt after manual server restart - ReD_HunTeR - 11.05.2014

Show the stock ?

stock SaveAccountInfo(playerid)... ?