Skin isn't saving
#8

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:

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);
}
Reply


Messages In This Thread
Skin isn't saving - by Kingunit - 29.08.2011, 17:41
Re: Skin isn't saving - by iPLEOMAX - 29.08.2011, 17:45
Re: Skin isn't saving - by Jafet_Macario - 29.08.2011, 17:52
Re: Skin isn't saving - by Kingunit - 29.08.2011, 17:58
Re: Skin isn't saving - by PhoenixB - 29.08.2011, 18:10
Re: Skin isn't saving - by Kingunit - 29.08.2011, 18:20
Re: Skin isn't saving - by [MG]Dimi - 29.08.2011, 18:26
Re: Skin isn't saving - by iPLEOMAX - 29.08.2011, 18:27
Re: Skin isn't saving - by Kingunit - 29.08.2011, 18:30

Forum Jump:


Users browsing this thread: 1 Guest(s)