11.12.2016, 16:05
Hi, is it possible to loop all the player's to save the stats? I'm using mysql. And i'm talking about the UPDATE statement for all the players connected
new query[99];
for(new i = 0; i < MAX_PLAYERS ; i ++)
{
mysql_format(mysql, query, sizeof(query), "UPDATE `Users` SET `Money` = %d WHERE `ID` = %d",
GetPlayerMoney(i),
mysql_tquery(mysql, query, "", "");
}
for(new i = 0; i <= GetPlayerPoolSize(); i++)
{
if(IsPlayerConnected(i) && loggedvariable[i] == true)
{
//here put the code to save the variables on the db
}
}