29.04.2011, 12:47
Okay, I need help about making it. I wanted to set player animation if he has lower than 15HP. Anyone has idea?
If(GetPlayerHealth(playerid) > 15)
{
ApplyAnimation(....);
}
|
Originally Posted by SA-MP
This forum requires that you wait 120 seconds between posts. Please try again in 43 seconds.
|
public OnPlayerUpdate(playerid)
{
// blah blah blah
new Float:health;
GetPlayerHealth(playerid, health);
if (health < 15.0 && GetPVarInt(playerid, "fallanim") == 0)
{
SendClientMessage(playerid, 0xff0000ff, "* You have been injured!");
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
SetPVarInt(playerid, "fallanim", 1);
}
else if (health > 15.0 && GetPVarInt(playerid, "fallanim") == 1) // fixed
{
SetPVarInt(playerid, "fallanim", 0);
if (GetPlayerAnimationIndex(playerid) == 386) ClearAnimations(playerid, 1);
SendClientMessage(playerid, 0x00ff00ff, "* You have been healed!");
}
// blah blah blah
}