31.05.2017, 23:44
PHP код:
//OnGameModeInIT
SetTimer("SaveAllPlayerData",180000,1);
forward SaveAllPlayerData();
public SaveAllPlayerData()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
if( IsPlayerConnected( i ) )
{
new query[600];
mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `IP` = '%e', `Admin` = %d, `Tokens` = %d, `Kills` = %d,`Deaths` = %d, `Score` = %d, `Money` = %d, `Hours` = %d,\
`Minutes` = %d, `RaceWon` = %d WHERE `ID` = %d",
IP[i], pData[i][Admin], pData[i][Tokens], pData[i][Kills],pData[i][Deaths], GetPlayerScore(i),\
pData[i][Money], pData[i][pHours], pData[i][pMinutes],pData[i][RaceWon], pData[i][ID]);
mysql_tquery(mysql, query);
}
new str[128];
SendClientMessageToAll(0x009D00DB,"* Admin spork007 has saved your stats");
format(str, sizeof(str),"* Admin spork007 has saved all online players stats");
IRC_GroupSay(groupID, IRC_CHANNEL, str);
}
return 1;
}