03.08.2018, 12:46
Hi all.
Under OnPlayerDisconnect I call the function
This is the SavePlayer function.
Often it saves, but randomly on restarts and at other times it will wipe my statistics. Any ideas?
Under OnPlayerDisconnect I call the function
pawn Код:
SavePlayer(playerid);
pawn Код:
SavePlayer(playerid)
{
new DB_Query[256];
mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `PLAYERS` SET `SCORE` = %d, `KILLS` = %d, `CASH` = %d, `DEATHS` = %d, `ADMIN` = %d, `SKIN` = %d, `TOKENS` = %d, `DONATOR` = %d, `NAMECHANGES` = %d, `HEADSHOTS`= %d WHERE `ID` = %d LIMIT 1",
pInfo[playerid][Score], pInfo[playerid][Kills], pInfo[playerid][Cash], pInfo[playerid][Deaths], pInfo[playerid][Admin], pInfo[playerid][Skin], pInfo[playerid][Tokens], pInfo[playerid][Donator], pInfo[playerid][Namechanges], pInfo[playerid][Headshots], pInfo[playerid][ID]);
mysql_tquery(Database, DB_Query);
return 1;
}