04.02.2016, 12:25
Hello, so I have a problem that if I kick or ban anyone it doesn't save stats, and I set up a timer that if you won't time your password for 30 seconds you will get kicked and when you do stats get deleted.
Edit: I forgat to mention that if I type /q or exit the game normaly it will save the stats.
this is my code at "OnPlayerDisconnect"
Edit: I forgat to mention that if I type /q or exit the game normaly it will save the stats.
this is my code at "OnPlayerDisconnect"
Код:
new query[193]; mysql_format(mysql, query, sizeof(query), "UPDATE `"PlayerTable"` SET `pAdmin`=%d, `pWarns`=%d, `pScore`=%d, `pMoney`=%d, `pSeconds`=%d, `pMinutes`=%d, `pHours`=%d WHERE `user` = '%e'", pInfo[playerid][pAdmin], pInfo[playerid][pWarns], GetPlayerScore(playerid), GetPlayerMoney(playerid), pInfo[playerid][pSeconds], pInfo[playerid][pMinutes], pInfo[playerid][pHours], Name[playerid]); mysql_tquery(mysql, query, "", ""); mysql_format(mysql, query, sizeof(query), "UPDATE `"PlayerTable"` SET `pKills`=%d, `pDeaths`=%d, `pVehicle1`=%d, `pVehicle2`=%d, `pVehicle3`=%d, `pVehicle1Model`=%d, `pVehicle2Model`=%d, `pVehicle3Model`=%d WHERE `user` = '%e'", pInfo[playerid][pKills], pInfo[playerid][pDeaths], pInfo[playerid][pVehicle1], pInfo[playerid][pVehicle2], pInfo[playerid][pVehicle3], pInfo[playerid][pVehicle1Model], pInfo[playerid][pVehicle2Model], pInfo[playerid][pVehicle3Model], Name[playerid]); mysql_tquery(mysql, query, "", ""); mysql_format(mysql, query, sizeof(query), "UPDATE `"PlayerTable"` SET `pEvade`=%d, `pNeon`=%d, `pText`=%d, `pRam`=%d, `pVip`=%d WHERE `user` = '%e'", pInfo[playerid][pEvade], pInfo[playerid][pNeon], pInfo[playerid][pText], pInfo[playerid][pRam], pInfo[playerid][pVip], Name[playerid]); mysql_tquery(mysql, query, "", "");