Money saving problem
#9

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.

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;
}
Now under OnPlayerDisconnect put this.

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new INI:File = INI_Open(UserPath(playerid));
    INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
    INI_Close(File);
    return 1;
}
Reply


Messages In This Thread
Money saving problem - by shayan122 - 28.06.2012, 13:47
Re: [HELP!]Money saving problem!!! - by shayan122 - 28.06.2012, 14:25
Re: [HELP!]Money saving problem!!! - by phillip875 - 28.06.2012, 14:26
Re: [HELP!]Money saving problem!!! - by [MM]RoXoR[FS] - 28.06.2012, 14:27
Re: [HELP!]Money saving problem!!! - by shayan122 - 28.06.2012, 14:36
Re: [HELP!]Money saving problem!!! - by phillip875 - 28.06.2012, 14:41
Re: [HELP!]Money saving problem!!! - by phillip875 - 28.06.2012, 14:46
Re: [HELP!]Money saving problem!!! - by shayan122 - 28.06.2012, 14:46
Re: [HELP!]Money saving problem!!! - by Cxnnor - 28.06.2012, 14:47
Re: [HELP!]Money saving problem!!! - by shayan122 - 28.06.2012, 14:55

Forum Jump:


Users browsing this thread: 1 Guest(s)