Deposit problem
#1

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.
Reply
#2

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

add "sscanf" and "dcmd" in your script.
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 4 Guest(s)