15.04.2013, 20:30
Hello, someone can help me with this pickups? I don't wanna let players pickup this pickups if they have more than 85 hp/armour:
I got no errors while compiling, but ingame it allows me to pickup that pickups even if i have 90 hp..
I wanna set this pickups to be pickupable ONLY if u have < 85 score.
pawn Код:
if(pickupid == HealthPickup)
{
new Float:phealth;
GetPlayerHealth(playerid,phealth);
if(phealth >= 85)
{
SendClientMessage(playerid,red,"Your health is already full. You can't take this pickup.");
return 1;
}
else GivePlayerHealth(playerid,5);
}
if(pickupid == ArmourPickup)
{
new Float:parm;
GetPlayerArmour(playerid,parm);
if(parm >= 85)
{
SendClientMessage(playerid,red,"Your armour is already full. You can't take this pickup.");
return 1;
}
else GivePlayerArmour(playerid,5);
}
I wanna set this pickups to be pickupable ONLY if u have < 85 score.