14.04.2011, 00:51
I wish to have if your health is 25 you will do /crack and cant move. Thank you . I looked on the SA-MP and i didnt understand
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;
}
// put this at the top of onplayerupdate
new Float:Health;
GetPlayerHealth(playerid,Health);
// replace the other GetPlayerHealth(playerid) with
Health