SA-MP Forums Archive
Deposit 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Deposit problem (/showthread.php?tid=67213)



Deposit problem - neosy - 27.02.2009

Hello everyone,

Yes, I do have a problem involving a banking script. I've already tried searching for the answer but none of the topics really helped me, so I decided to start a new one.
The script does work untill the money check, if I for example use /storten(deposit) 2000 it would tell me I'd have enough money to do so. But the problem is the actual depositing. I use this:
Код:
new depamount;
new actualamount;
depamount = strval(tmp);
GetPlayerName(playerid, playername, sizeof(playername));
if (dini_Int(udb_encode(playername), "moneyinpocket") >= depamount)
{
actualamount = dini_Get(playername, "moneyinpocket");
dini_IntSet(playername, "moneyinpocket", actualamount - depamount);
SendClientMessage(playerid,YELLOW,"Money deposited.");
ShowMenuForPlayer(baymorebankgeldzakenMenu,playerid);
}
else
{
SendClientMessage(playerid,YELLOW,"You do not have that money.");
ShowMenuForPlayer(baymorebankgeldzakenMenu,playerid);
}
Any ideas?

Thanks in advance.


Re: Deposit problem - X_Dragon - 16.01.2010

maybe it helps:
https://sampwiki.blast.hk/wiki/Sscanf
https://sampwiki.blast.hk/wiki/Fast_Commands

add "sscanf" and "dcmd" in your script.



Re: Deposit problem - MadeMan - 16.01.2010

pawn Код:
actualamount = dini_Get(playername, "moneyinpocket");
change to

pawn Код:
actualamount = dini_Int(playername, "moneyinpocket");