20.02.2012, 11:08
so, I never used OnPlayerUpdate, but will this code lag it or is it small enough?
pawn Код:
public OnPlayerUpdate(playerid)
{
if(iscracked[playerid] == 0)
{
new Float:h;
GetPlayerHealth(playerid, h);
if(h < 11)
{
new Float:u, Float:u2, Float:u3;
GetPlayerPos(playerid, u, u2, u3);
iscracked[playerid] = 1;
TogglePlayerControllable(id, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0); // Dieing of Crack
SetTimerEx("uncrack", 240000, false, "i", playerid);
CrackLabel[playerid] = Create3DTextLabel("Injured", COLOR_BLUE, u, u2, u3 + 2, 10, 0);
}
}
return 1;
}