15.11.2010, 12:04
Im trying to avoid that bug from dini, which doesn't saves after use my setlevel command. So, I did that:
End of GM now:
This code is for save all players stats, like hot, cold, level, money, score, each 60sec(1min). So, anyone have a way to keep the lag away? cause it keeps saying on the server:
And on the console the printf. Ty.
Code:
forward database(playerid);
Code:
public OnGameModeInit()
{
SetTimer("database", 60000, false);
return 1;
}
Code:
public database(playerid)
{
for(new v = 0; v < MAX_PLAYERS; ++v)
{
dini_IntSet(file, "Score", GetPlayerScore(v));
dini_IntSet(file, "Money", GetPlayerMoney(v));
dini_IntSet(file, "level", PlayerInfo[v][Level]);
dini_IntSet(file, "Cold", PlayerInfo[v][Cold]);
dini_IntSet(file, "Hot", PlayerInfo[v][Hot]);
SendClientMessageToAll(AZUL, "Database: all player stats were saved");
printf("Database: all player stats were saved");
SetTimer("database", 60000, true);
}
return 1;
}
Code:
endClientMessageToAll(AZUL, "Database: all player stats were saved"); endClientMessageToAll(AZUL, "Database: all player stats were saved"); endClientMessageToAll(AZUL, "Database: all player stats were saved"); endClientMessageToAll(AZUL, "Database: all player stats were saved"); endClientMessageToAll(AZUL, "Database: all player stats were saved");


