15.02.2016, 23:26
Okay so ive been working on a leg breaking system, there are two things going wrong, if a player hits them with fists it will break their leg, and if they get hit in the chest or torso it will still break their leg, i have it set to bodypart = 7 and bodypart = 8 but it still does it, i've added teams but when i have the teams and test it, it doesnt carry out the function.
// Body parts
#define BODY_PART_GROIN 4
#define BODY_PART_RIGHT_ARM 5
#define BODY_PART_LEFT_ARM 6
#define BODY_PART_RIGHT_LEG 7
#define BODY_PART_LEFT_LEG 8
new boolLegBroken[MAX_PLAYERS];
// Body parts
#define BODY_PART_GROIN 4
#define BODY_PART_RIGHT_ARM 5
#define BODY_PART_LEFT_ARM 6
#define BODY_PART_RIGHT_LEG 7
#define BODY_PART_LEFT_LEG 8
new boolLegBroken[MAX_PLAYERS];
Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart) { if(issuerid != INVALID_PLAYER_ID || weaponid == 22 || weaponid == 23 || weaponid == 24 || weaponid == 25 || weaponid == 26 || weaponid == 27 || weaponid == 28 || weaponid == 29 || weaponid == 30 || weaponid == 31 || weaponid == 32 || weaponid == 33 || weaponid == 34 || weaponid == 35 || weaponid == 36 || weaponid == 37 || weaponid == 38 && bodypart == 7 || bodypart == 8) { if(pLegBroken[playerid] == false) { pLegBroken[playerid] = true; ApplyAnimation(playerid, "PED", "CLIMB_jump2fall", 4.1, 1, 0, 0, 1, 0); SCM(playerid, COLOR_LIGHTRED, "-> You've been hit in the leg, you're going to struggle with running and jumping."); } } return 1; }
Код:
if (pLegBroken[playerid]) { if (newkeys & KEY_SPRINT || newkeys & KEY_JUMP) ApplyAnimation(playerid, "PED", "CLIMB_jump2fall", 4.1, 0, 0, 0, 1, 0); }