I have never done a Broken Leg System it's more of a Role Play thing if you ask me, anyway I made this just now, it should work If it does not try switching the cases from 7, 8 to BODY_PART_LEFT_LEG, BODY_PART_RIGHT_LEG (Remove the //). Also, try switching the animations for your favour.
PHP код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
switch(bodypart)
{
// case BODY_PART_LEFT_LEG, BODY_PART_RIGHT_LEG:
case 7, 8:
{
SendClientMessage(playerid, -1, "You've been shot in your leg.");
//ApplyAnimation(playerid, "PED", "CLIMB_jump2fall", 4.1, false, false, false, false, false);
ApplyAnimation(playerid,"PED","FALL_collapse", 4.1, false, false, false, true, false);
SetTimerEx("Recovery", 5000, false, "i", playerid);// Healing the Player
}
}
return true;
}
forward Recovery(playerid);
public Recovery(playerid)
{
SendClientMessage(playerid, -1, "Successfully Recovered");
ClearAnimations(playerid);
return true;
}