Help with Health and Armour (Limits)
#1

I need a little help. The codes below works so good but the problem was every time my health goes below 100 hp. Let say 70 hp then I picked up a health, now my health became 120 hp (It goes over 100 hp limit)

So can someone please help me with this what code should I add to make amount limit for both armour and health?

Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == lvapickup1)
	{
        new Float:armour;
        GetPlayerArmour(playerid,armour);
        if(armour < 100)
        {
            SetPlayerArmour(playerid, armour+50);
            GameTextForPlayer(playerid, "~g~Armour +50", 3000, 3);
        }
        else
        {

        }
	}
    else if(pickupid == lvapickup2)
    {
        new Float:hp;
        GetPlayerHealth(playerid,hp);
        if(hp < 100)
        {
            SetPlayerHealth(playerid, hp+50);
            GameTextForPlayer(playerid, "~g~Health +50", 3000, 3);
        }
        else
        {

        }
    }
    return 1;
}
Reply


Messages In This Thread
Help with Health and Armour (Limits) - by kbalor - 16.10.2014, 06:49
Re: Help with Health and Armour (Limits) - by RockyGamer - 16.10.2014, 07:52
Re: Help with Health and Armour (Limits) - by kbalor - 16.10.2014, 08:08
Re: Help with Health and Armour (Limits) - by Threshold - 16.10.2014, 08:15
Re: Help with Health and Armour (Limits) - by RockyGamer - 16.10.2014, 08:18
Re: Help with Health and Armour (Limits) - by kbalor - 16.10.2014, 08:22

Forum Jump:


Users browsing this thread: 1 Guest(s)