SA-MP Forums Archive
saving "amount" with a PVar - 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: saving "amount" with a PVar (/showthread.php?tid=206567)



saving "amount" with a PVar - Haydz - 04.01.2011

fixed


Re: saving "amount" with a PVar - Kwarde - 04.01.2011

pawn Код:
new amount = strval(inputtext);
                if(!(1000 <= amount <= 1000000)) return SendClientMessage(playerid, COLOR_RED, "Invalid Amount, Min wager - $1000, Max wager - $1000000");
                {
                    if(GetPlayerMoney(playerid) < amount) return SendClientMessage(playerid, COLOR_RED,"You don't have that much cash!");
                    {
                                         //some other code here aswell.
                        amount = SetPVarInt(playerid,"amount",playerid);
                    }
                }
should be
pawn Код:
new amount = strval(inputtext);
if(!(1000 <= amount <= 1000000)) return SendClientMessage(playerid, COLOR_RED, "Invalid Amount, Min wager - $1000, Max wager - $1000000");
if(GetPlayerMoney(playerid) < amount) return SendClientMessage(playerid, COLOR_RED,"You don't have that much cash!");

amount = SetPVarInt(playerid,"amount", ammount); //You did set the ammount to the player's ID
I can't help you from now. Gotta go to school