15.09.2016, 18:43
Nothing happens until the player reaches 0 hp.
Under OnPlayerTakeDamage.
pawn Код:
if(LoggedIn[playerid] == 1 && Health <= 35 && KnockedOut[playerid] == 0 && GetPlayerState(playerid) != 9)
{
if(IsPlayerInAnyVehicle(playerid))
{
RemovePlayerFromVehicle(playerid);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0,1);
TogglePlayerControllable(playerid, 0);
}
KnockedOut[playerid] = 1;
TogglePlayerControllable(playerid, 0);
ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0,1);
SendClientMessage(playerid, COLOUR_REALRED, "You have been knocked out, unless someone revives you, you may die.");
format(string, sizeof(string), "* %s has lost consciousness due to their injuries *", GetNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE, COLOUR_PURPLE);
return 1;
}