20.01.2014, 18:48
I've debugged my script, and when server is restarting (GMX) player data is saving to the database, but not everything. Basically I am getting X, Y, Z, A etc.. and X, Y is not being saved but surprisingly Z position is being saved, skinid and other things. Should I make a seprate command for restart to save data and everything else before, and then when timer passed, just SendRconCommand to restart server?
I know that GMX is loading next gamemode from server.cfg, but it should do it (the thing I want), right?
Debug:
Well, it stopped saving Z pos, now. However, other data (skin, health) are being saved. Data is saving properly when server has been closed (close rcon command)
edit:\\
Seems like server is exiting first, so I just can't grab player's current data. Looks like I'll have to set a timer for GMX. If anyone has better solution, or I am wrong.. please say.
I know that GMX is loading next gamemode from server.cfg, but it should do it (the thing I want), right?
pawn Код:
public OnGameModeExit()
{
foreach(new playerid : Player)
{
OnPlayerDisconnectEx(playerid);
}
mysql_close();
[...]
pawn Код:
UPDATE `playerdata` SET `health` = 100.000000, `skinid` = 71, `volume` = 100, `online` = 0, `LastX` = 0.000000, `LastY` = 0.000000, `LastZ` = 0.000000, `LastA` = 0.000000, `LastINT` = 0, `LastVW` = 0 WHERE `UID` = 1
edit:\\
Seems like server is exiting first, so I just can't grab player's current data. Looks like I'll have to set a timer for GMX. If anyone has better solution, or I am wrong.. please say.