22.08.2011, 17:19
That code looks good to me, the only thing that come to my mind is; "gPlayerLogged[a]" may be zero for some reason. (i know thats unlikely but...)
Try putting some prints in there to see what gets executed and display some data.
EG,
Try putting some prints in there to see what gets executed and display some data.
EG,
pawn Код:
for(new a; a < MAX_PLAYERS; a++)
{
if(!IsPlayerConnected(a))continue;
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(a, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(gPlayerLogged[a] == 1)
{
dini_IntSet(file, "Score", PlayerInfo[a][pScore]);
dini_IntSet(file, "Money", PlayerInfo[a][pCash]);
dini_IntSet(file, "Kicks", PlayerInfo[a][pKicks]);
dini_IntSet(file, "Bans", PlayerInfo[a][pBans]);
dini_IntSet(file, "Kills", PlayerInfo[a][pKills]);
dini_IntSet(file, "Deaths", PlayerInfo[a][pDeaths]);
dini_IntSet(file, "AdminLevel",PlayerInfo[a][pAdminLevel]);
printf("Player (id: %d) %s: stats saved to filepath: %s.\n", a, name, file);
}
gPlayerLogged[a] = 0;
}