Stop cash going into negative
#1

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

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
    }
Reply
#3

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

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


Forum Jump:


Users browsing this thread: 2 Guest(s)