16.10.2014, 06:49
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?
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;
}


