31.08.2013, 13:44
Hello, I'm making an admin system for my server, however I have a little problem with saving the player stats when they disconnect
so here's the code:
For some reason it won't save the stats into the requested file :/
any help?
Thanks in advance
so here's the code:
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if (PInfo[playerid][Logged] == 1)
{
new file[64],PlayerName[24];
GetPlayerName(playerid,PlayerName,sizeof PlayerName);
format(file,sizeof file,"Admin/%s.ini",PlayerName);
PInfo[playerid][Score] = GetPlayerScore(playerid);
PInfo[playerid][Money] = GetPlayerMoney(playerid);
PInfo[playerid][Skin] = GetPlayerSkin(playerid);
INI_Open(file);
INI_WriteInt("Money",PInfo[playerid][Money]);
INI_WriteInt("Score",PInfo[playerid][Money]);
INI_WriteInt("Skin",PInfo[playerid][Skin]);
INI_Save();
INI_Close();
PInfo[playerid][Logged] = 0;
}
return 1;
}
any help?
Thanks in advance

