16.10.2014, 08:18
I'm sorry for not noticing that you sad you want +50 health. So here is the code for that!
Once again I'm really sorry for not noticing.
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == lvapickup1)
{
new Float:armour;
GetPlayerArmour(playerid,armour);
if(armour < 50)
{
SetPlayerArmour(playerid, armor+50);
GameTextForPlayer(playerid, "~g~Armour +50", 3000, 3);
}
else
{
SetPlayerArmour(playerid, 100);
GameTextForPlayer(playerid, "~g~Armour 100%", 3000, 3);
}
}
else if(pickupid == lvapickup2)
{
new Float:health;
GetPlayerHealth(playerid,health);
if(health < 50)
{
SetPlayerHealth(playerid, health+50);
GameTextForPlayer(playerid, "~g~Health +50", 3000, 3);
}
else
{
SetPlayerHealth(playerid, 100);
GameTextForPlayer(playerid, "~g~Health 100%", 3000, 3);
}
}
return 1;
}