[help] else function
#2

The else statement wouldn't work because there is no if statement in there to check the player's cash, you need to check if the player has enough money if you want to put something if they don't.

pawn Код:
if (pickupid == who)
    {
   
            if (GetPlayerMoney(playerid) >= 1000) // if player has $1000+
            {
                new pname[24], string[128];
                GetPlayerName(playerid, pname, sizeof(pname));
                format(string, sizeof(string), "%s has just purchased MR.Whoopey fleet of vehicles.", pname);
                SendClientMessageToAll(0x33AA33AA, string);
                SendClientMessage(playerid, 0xFFA500AA, "Better go serve some ice cream!.");
                GivePlayerMoney(playerid, -1000);
            }
            else
            {
                SendClientMessage(playerid, 0xFFA500AA, "You dont have enough cash for this price: $1000");
            }

      }
Reply


Messages In This Thread
[help] else function - by [mad]MLK - 19.07.2009, 17:12
Re: [help] else function - by member - 19.07.2009, 17:18
Re: [help] else function - by James_Alex - 19.07.2009, 17:19
Re: [help] else function - by [mad]MLK - 19.07.2009, 17:20
Re: [help] else function - by James_Alex - 19.07.2009, 17:22
Re: [help] else function - by [mad]MLK - 19.07.2009, 17:26
Re: [help] else function - by gemadon - 31.07.2009, 18:22
Re: [help] else function - by iLinx - 31.07.2009, 18:29

Forum Jump:


Users browsing this thread: 1 Guest(s)