SA-MP Forums Archive
Money saving problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Money saving problem (/showthread.php?tid=354965)



Money saving problem - shayan122 - 28.06.2012

Hello im using SFCRRPG GM and after relog money will change to $7500

how can i make it stay same? like when you have $12000 and relog, you still have same cash

and in Gm i have:

Код:
  dUserSetINT(PlayerName(playerid)).("money",7500);
  dUserSetINT(PlayerName(playerid)).("bankcash",5000);
  dUserSetINT(PlayerName(playerid)).("loancash",0);
  dUserSetINT(PlayerName(playerid)).("cashinsured",0);
Edit: when i change 7500 to 0 its still 7500! -.-


Re: [HELP!]Money saving problem!!! - shayan122 - 28.06.2012

AnyOne HelP!?


Re: [HELP!]Money saving problem!!! - phillip875 - 28.06.2012

I would help, but I don't know that File writter.


Re: [HELP!]Money saving problem!!! - [MM]RoXoR[FS] - 28.06.2012

Make sure you are giving cash when connecting


Re: [HELP!]Money saving problem!!! - shayan122 - 28.06.2012

Quote:
Originally Posted by phillip875
Посмотреть сообщение
I would help, but I don't know that File writter.
its SFCRRPG GameMode By Stevo127

Link: https://sampforum.blast.hk/showthread.php?tid=223963




Quote:
Originally Posted by [MM]RoXoR[FS]
Посмотреть сообщение
Make sure you are giving cash when connecting
What you mean exactly? could you please explain me some more ?


Re: [HELP!]Money saving problem!!! - phillip875 - 28.06.2012

If you can wait 20minutes or so, I can give you your answer


Re: [HELP!]Money saving problem!!! - phillip875 - 28.06.2012

Anyway I could change the file writter to dini or DOF2?

Can't find the file writter from the GM


Re: [HELP!]Money saving problem!!! - shayan122 - 28.06.2012

im waiting , and Thanks


Re: [HELP!]Money saving problem!!! - Cxnnor - 28.06.2012

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



Re: [HELP!]Money saving problem!!! - shayan122 - 28.06.2012

Quote:
Originally Posted by phillip875
Посмотреть сообщение
Anyway I could change the file writter to dini or DOF2?

Can't find the file writter from the GM
i dont think so because there are :
Army Group - Cia Group - Regular players - Admin system ... In it !