28.06.2012, 14:47
Mind posting the OnPlayerConnect and OnPlayerDisconnect code? Then I can help.
EDIT: Never mind. Add this to the top of your script below the defines etc.
Now under OnPlayerDisconnect put this.
EDIT: Never mind. Add this to the top of your script below the defines etc.
pawn Код:
enum pInfo
{
pCash,
}
pawn Код:
new PlayerInfo[MAX_PLAYERS][pInfo];
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_Int("Cash",PlayerInfo[playerid][pCash]);
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_Close(File);
return 1;
}