forward checkcrack(playerid);
public checkcrack(playerid)
{
new Float:h;
GetPlayerHealth(playerid, h);
if(h < 20)
{
if(iscracked[playerid] == 0)
{
new Float:u, Float:u2, Float:u3;
GetPlayerPos(playerid, u, u2, u3);
iscracked[playerid] = 1;
TogglePlayerControllable(playerid, 0);
SetCameraBehindPlayer(playerid);
ApplyAnimation(playerid,"CRACK","crckdeth2",4.0,1,0,0,0,1);
ApplyAnimation(playerid,"CRACK","crckdeth2",4.0,1,0,0,120000,1);
cracktime[playerid] = SetTimerEx("uncrack", 120000, false, "i", playerid);
CrackLabel[playerid] = Create3DTextLabel("Injured", COLOR_RED, u, u2, u3, 15, 0);
}
}
return 1;
}
new Float:h; GetPlayerHealth(playerid, h); if(h < 20)
new
CrackVariable[ MAX_PLAYERS ]
;
stock TogglePlayerControllableEx( playerid, bool:toggle )
{
if( toggle )
CrackVariable[ playerid ] = SetTimerEx( "CrackTimer", 100, true, "i", playerid );
else
KillTimer( CrackVariable[ playerid ] );
return 1;
}
forward CrackTimer( playerid );
public CrackTimer( playerid )
{
new
Float:x,
Float:y,
Float:z
;
GetPlayerPos( playerid, x, y, z );
SetPlayerPos( playerid, x, y, z );
SetCameraBehindPlayer( playerid );
// Set the anim afterwards.
return 1;
}
as first why you make the health define a float?:
Код:
new Float:h; GetPlayerHealth(playerid, h); if(h < 20) |