Problem mixing up two things in a if function
#2

pawn Код:
if (strcmp("/heal", cmdtext, true, 10) ==0)
    {
    new Float:Health,str[128];
    GetPlayerHealth(playerid, Health);
    if (Health < 50.0)
            {
            SendClientMessage(playerid,0xD10000FF, "You are too low on health to heal yourself!");
            return 1;
            }
    else
            {
             if(GetPlayerMoney(playerid) < 1000)
                 {
                format(str,sizeof(str),"You haven't got enough money to heal yourself (Your money: $%i Needed: $1000)",GetPlayerMoney(playerid))
            return SendClientMessage(playerid,0xD10000FF ,str);
                }
            SetPlayerHealth(playerid, 100);
            SendClientMessage(playerid,0x009900FF,"You have healed yourself for $1000!");
            GivePlayerMoney(playerid, -1000);
            return 1;
            }

    }
Reply


Messages In This Thread
Problem mixing up two things in a if function - by Amsterdam - 13.03.2014, 19:59
Re: Problem mixing up two things in a if function - by Matess - 13.03.2014, 20:09
Re: Problem mixing up two things in a if function - by RenSoprano - 13.03.2014, 20:10
Re: Problem mixing up two things in a if function - by Threshold - 13.03.2014, 23:24

Forum Jump:


Users browsing this thread: 2 Guest(s)