09.04.2019, 23:34
I would like to add SetTimer every 1 minute to OnGameModeInit so that the accounts are saved to all players. I do not want it to be for one player only for all players. How to do it in MySQL BlueG?
It does not work:
It does not work:
Code:
forward SavePlayersAll();
public SavePlayersAll()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pLogged[i])
{
new query[650];
PlayerInfo[i][Money] = GetPlayerMoney(i);
mysql_format(g_SQL, query, sizeof(query), "UPDATE `accounts` SET `Money` = %d WHERE `ID` = %d LIMIT 1", PlayerInfo[i][Money], PlayerInfo[i][ID]);
mysql_tquery(g_SQL, query);
}
}
}
SendClientMessageToAll(-1, "All accounts have been saved!");
return 1;
}

