27.02.2013, 22:30
How to make that when player has 5 hp remaining to apply animation crack_deth so he cant run and walk?
new
AlmostDead [ MAX_PLAYERS ] = 0; // Create this player variable on the top of the script.
public OnPlayerUpdate ( playerid )
{
if( AlmostDead [ playerid ] == 1 ) return true;
new
Float: health;
GetPlayerHealth ( playerid, health );
if( health <= 5.0 )
{
ApplyAnimation ( playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0 );
ApplyAnimation ( playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0 );
// Apply the animation twice so it works without preloading.
TogglePlayerControllable ( playerid, false );
// This is optional - warning, it makes them invincible if they can't control their character.
AlmostDead [ playerid ] = 1;
}
return true;
}