if(issuerid != INVALID_PLAYER_ID && weaponid == 30 && bodypart == 3)
{
if (GetPlayerState(playerid) != PLAYER_STATE_WASTED)
{
if(BodyPart[playerid][Body] >= 5)
{
format(str,sizeof(str),"%s(%i) groans in pain from the bullets that pierced his chest and fell on the ground.",PlayerName(playerid),playerid);
SendNearbyMessage(playerid,30.0,str,ORANGE);
ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.1,1,0,0,0,0,1);
ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.1,1,0,0,0,0,1);
BodyPart[playerid][Torso] = 1;
BodyPart[playerid][Injured] = 1;
SendClientMessage(playerid,LRED,"You are slowly starting to die, you can try to get a medic or accept your death with /acceptdeath");
}
else
{
BodyPart[playerid][Body] += 1;
}
}
}
OnPlayerUpdate(playerid) { if(BodyPart[playerid][Injured]) { ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.1,1,0,0,0,0,1); } }
I'm not sure how that happens but I recommend you using OnPlayerUpdate for your animation.
You won't have to repeat the anim in OnPlayerTakeDamage and it'll be impossible for the player to get out of the animation or move from their death position. Example: Код:
OnPlayerUpdate(playerid) { if(BodyPart[playerid][Injured]) { ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.1,1,0,0,0,0,1); } } |
if(Inventory[playerid][KevlarEquip] == 0;
{
if (GetPlayerState(playerid) != PLAYER_STATE_WASTED)
{
format(str,sizeof(str),"%s(%i) groans in pain from the bullet that pierced his chest and fell on the ground.",PlayerName(playerid),playerid);
SendNearbyMessage(playerid,30.0,str,ORANGE);
ApplyAnimation(playerid, "SWEET", "Sweet_injuredloop", 4.1,1,0,0,0,0,1);
BodyPart[playerid][Torso] = 1;
BodyPart[playerid][Injured] = 1;
SendClientMessage(playerid,LRED,"You are slowly starting to die, you can try to get a medic or accept your death with /acceptdeath");
}
}
stock SetPlayerArmourEx(playerid,Float:AP) { if(AP>99.0)AP=99.0; Armor[playerid]=AP; return SetPlayerArmour(playerid,AP); }