29.08.2011, 18:27
If you close your server suddenly, It doesn't get any chance to save stats.
(or there is nothing that saves it on gmx)
Try something like this:
(or there is nothing that saves it on gmx)
Try something like this:
pawn Код:
forward SavePlayerStats(playerid);
public SavePlayerStats(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Kills",PlayerInfo[playerid][Kills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][Deaths]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Adminlevel",PlayerInfo[playerid][Adminlevel]);
INI_WriteInt(File,"Skin",GetPlayerSkin(playerid));
INI_Close(File);
return true;
}
//OnPlayerDisconnect:
SavePlayerStats(playerid);
//OnDialogResponse:
SavePlayerStats(playerid);
//OnGameModeExit:
for(new i=0; i<MAX_PLAYERS; i++) //or foreach(Player, i)
{
if(IsPlayerConnected(i)) SavePlayerStats(playerid);
}