SA-MP Forums Archive
Stop cash going into negative - 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: Stop cash going into negative (/showthread.php?tid=450800)



Stop cash going into negative - RandomDude - 14.07.2013

Is there a possible way to stop cash going into negatives...
Because if you purchase a weapon and you can carry on and you keep going into negative money... -_-


Re: Stop cash going into negative - Boolean - 14.07.2013

You have to check if the player has any money on him.

pawn Код:
new money = GetPlayerMoney(playerid);
    if(money >= 100) // Checks if the player has 100 cash or more.
    {
        // Give weapon
    }
    else // If the player doesen't have enough cash
    {
        // Error Message
    }



Re: Stop cash going into negative - Akcent_Voltaj - 14.07.2013

PHP код:
if(GetPlayerCash(playerid) <= 100) return SendClientMessage(playeridCOLOR_RED"//MESAGE//"); 



Re: Stop cash going into negative - JimmyCh - 14.07.2013

pawn Код:
if(GetPlayerMoney(playerid) > 0)
{
//Your code to buy weapons here
}