14.04.2011, 00:59
Use it on OnPlayerUpdate.
Something like:
Something like:
pawn Код:
OnplayerUpdate(playerid)
{
if(GetPlayerHealth(playerid) < 25.0 && GetPVarInt(playerid, "CrackAnimDone") == 0)
{
//ApplyCrackAnimHere
//Set here a variable so that the crack animation doesn't keep applying. Something like
SetPVarInt(playerid, "CrackAnimDone", 1);
TogglePlayerControllable(playerid, false);
}
else if(GetPVarInt(playerid, "CrackAnimDone") == 1 && GetPlayerHealth(playerid) > 25.0)
{
//remove the animation
SetPVarInt(playerid, "CrackAnimDone", 0);
TogglePlayerControllable(playerid, true);
}
return 1;
}