Player health lower than 15.0percents
#1

Okay, I need help about making it. I wanted to set player animation if he has lower than 15HP. Anyone has idea?
Reply
#2

you could make a command to make the animation apply when they have low hp, but the player would have to do it manually. just an idea
Reply
#3

Why not just use
pawn Код:
If(GetPlayerHealth(playerid) > 15)
{
    ApplyAnimation(....);
}
Then set a timer to check it and make a loop that checks all players.
Quote:
Originally Posted by SA-MP
This forum requires that you wait 120 seconds between posts. Please try again in 43 seconds.
Reply
#4

Код:
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
}
Reply
#5

fixed the above code
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)