05.04.2014, 17:45
pawn Код:
#define PATH "/Users/%s.ini"
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"money",GetPlayerMoney(playerid));
INI_WriteInt(File,"admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"score",PlayerInfo[playerid][pScore]);
INI_WriteInt(File,"vip",PlayerInfo[playerid][pVIP]);
INI_WriteInt(File,"killpoints",PlayerInfo[playerid][pKillPoints]);
INI_Close(File);
return 1;
}