Posts: 1,676
Threads: 44
Joined: Aug 2010
Reputation:
0
This is section where people have problem with there code not to request!
Posts: 887
Threads: 251
Joined: Jun 2011
Reputation:
0
Try using a timer and detect his HP, then apply an animation and send him a message.
Posts: 232
Threads: 4
Joined: Apr 2013
pawn Код:
new bool:PlayerFalled[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
PlayerFalled[playerid] = false;
return 1;
}
forward Ali(playerid);
public Ali(playerid)
{
new Float:H;GetPlayerHealth(playerid,H);
if(H < 10)
{
if(PlayerFalled[playerid] == false)
{
PlayerFalled[playerid] = true;
for(new i;i<2;i++) ApplyAnimation(playerid,"CRACK", "crckdeth2",4.1,1,1,1,1,10000);
TogglePlayerControllable(playerid,0);
SendClientMessage(playerid,-1,"You've got some damages wait for a medic.");
}
}
else
{
if(PlayerFalled[playerid] == true)
{
PlayerFalled[playerid] = false;
TogglePlayerControllable(playerid,1);
}
}
return 1;
}
new Timer[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
Timer[playerid] = SetTimerEx("Ali",1000,1,"i",playerid);
return 1;
}
public OnPlayerDeath(playerid)
{
KillTimer(Timer[playerid]);
if(PlayerFalled[playerid] == true)
{
PlayerFalled[playerid] = false;
}
return 1;
}
public OnPlayerDisconnect(playerid,reason)
{
if(Timer[playerid]) KillTimer(Timer[playerid]);
return 1;
}