Player health
#1

How to make that when player has 5 hp remaining to apply animation crack_deth so he cant run and walk?
Reply
#2

OnPlayerUpdate would probably be the only solution, short of a 500ms or so timer, so do this..

pawn Код:
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;
}
Reply
#3

dont togle player ... he wont be able to exit animation anyways...
Reply
#4

Quote:
Originally Posted by mastermax7777
Посмотреть сообщение
dont togle player ... he wont be able to exit animation anyways...
Hense the 'This is optional' comment.
Reply
#5

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)