12.04.2017, 09:30
Hello everyone,
I am creating a realistic damage response on getting shot on body parts.
Example code:
The problem is that, whenever a player is in an animation, and you shoot the players head when he is using an anim which lays him on the ground will injure his legs instead of head.
Is there any way to fix this?
I am creating a realistic damage response on getting shot on body parts.
Example code:
PHP код:
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;
}
}
}
Is there any way to fix this?