Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define BODY_PART_TORSO 3
- #define BODY_PART_GROIN 4
- #define BODY_PART_LEFT_ARM 5
- #define BODY_PART_RIGHT_ARM 6
- #define BODY_PART_LEFT_LEG 7
- #define BODY_PART_RIGHT_LEG 8
- #define BODY_PART_HEAD 9
- my_SetPlayerArmour(playerid, Float:amount)
- {
- if(amount < 0.0)
- {
- amount = 0.0;
- }
- return SetPlayerArmour(playerid, amount);
- }
- #if defined _ALS_SetPlayerArmour
- #undef SetPlayerArmour
- #else
- #define _ALS_SetPlayerArmour
- #endif
- #define SetPlayerArmour my_SetPlayerArmour
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
- {
- new Float: health,Float: armour;
- GetPlayerHealth(playerid, health);
- GetPlayerArmour(playerid, armour);
- switch(weaponid)
- {
- case 0: // Unarmed
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 5);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 3);
- }
- }
- }
- case 1: // Brass Knuckles
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 10);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 7);
- }
- }
- }
- case 2: // Golf Club
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 12);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 8);
- }
- }
- }
- case 3: // Nitestick
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 18);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 12);
- }
- }
- }
- case 4: // Knife
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 20);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 13);
- }
- }
- }
- case 5: // Bat
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 18);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 12);
- }
- }
- }
- case 6: // Shovel
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 12);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 9);
- }
- }
- }
- case 7: // Poolstick
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 12);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 9);
- }
- }
- }
- case 8: // Katana
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 30);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 15);
- }
- }
- }
- case 9: // chainsaw
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 1);
- }
- default:
- {
- SetPlayerHealth(playerid, health - 1);
- }
- }
- }
- case 10: // Dildo
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 5);
- }
- default:
- {
- SetPlayerArmour(playerid, armour - 5);
- }
- }
- }
- case 11: // Dildo
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 5);
- }
- default:
- {
- SetPlayerArmour(playerid, armour - 5);
- }
- }
- }
- case 12: // Dildo
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 5);
- }
- default:
- {
- SetPlayerArmour(playerid, armour - 5);
- }
- }
- }
- case 13: // Dildo
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 5);
- }
- default:
- {
- SetPlayerArmour(playerid, armour - 5);
- }
- }
- }
- case 14: // Flowers
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 5);
- }
- default:
- {
- SetPlayerArmour(playerid, armour - 5);
- }
- }
- }
- case 15: // Cane
- {
- switch(armour)
- {
- case 0:
- {
- SetPlayerHealth(playerid, health - 12);
- }
- default:
- {
- SetPlayerArmour(playerid, armour - 12);
- }
- }
- }
- case 22: // Colt 45
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 12); // Torso
- case 4: SetPlayerHealth(playerid, health - 11); // Groin
- case 5: SetPlayerHealth(playerid, health - 6); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 6); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 6); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 6); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 15); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 6); // Torso
- case 4: SetPlayerArmour(playerid, armour - 5); // Groin
- case 5: SetPlayerArmour(playerid, armour - 3); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 3); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 3); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 3); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 8); // Head
- }
- }
- }
- }
- case 23: // SD Pistol
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 18); // Torso
- case 4: SetPlayerHealth(playerid, health - 16); // Groin
- case 5: SetPlayerHealth(playerid, health - 10); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 10); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 10); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 10); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 20); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 12); // Torso
- case 4: SetPlayerArmour(playerid, armour - 11); // Groin
- case 5: SetPlayerArmour(playerid, armour - 6); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 6); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 6); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 6); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 15); // Head
- }
- }
- }
- }
- case 24: // Desert Eagle
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 40); // Torso
- case 4: SetPlayerHealth(playerid, health - 18); // Groin
- case 5: SetPlayerHealth(playerid, health - 8); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 8); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 8); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 8); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 50); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 30); // Torso
- case 4: SetPlayerArmour(playerid, armour - 14); // Groin
- case 5: SetPlayerArmour(playerid, armour - 6); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 6); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 6); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 6); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 40); // Head
- }
- }
- }
- }
- case 25: // Shotgun
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 40); // Torso
- case 4: SetPlayerHealth(playerid, health - 18); // Groin
- case 5: SetPlayerHealth(playerid, health - 8); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 8); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 8); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 8); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 50); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 30); // Torso
- case 4: SetPlayerArmour(playerid, armour - 14); // Groin
- case 5: SetPlayerArmour(playerid, armour - 6); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 6); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 6); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 6); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 40); // Head
- }
- }
- }
- }
- case 26: // Sawnoff Shotgun
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 14); // Torso
- case 4: SetPlayerHealth(playerid, health - 14); // Groin
- case 5: SetPlayerHealth(playerid, health - 8); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 8); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 8); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 8); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 24); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 14); // Torso
- case 4: SetPlayerArmour(playerid, armour - 14); // Groin
- case 5: SetPlayerArmour(playerid, armour - 7); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 7); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 7); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 7); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 22); // Head
- }
- }
- }
- }
- case 27: // Combat Shotgun
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 17); // Torso
- case 4: SetPlayerHealth(playerid, health - 12); // Groin
- case 5: SetPlayerHealth(playerid, health - 7); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 7); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 7); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 7); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 25); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 15); // Torso
- case 4: SetPlayerArmour(playerid, armour - 10); // Groin
- case 5: SetPlayerArmour(playerid, armour - 6); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 6); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 6); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 6); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 20); // Head
- }
- }
- }
- }
- case 28: // UZI
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 9); // Torso
- case 4: SetPlayerHealth(playerid, health - 7); // Groin
- case 5: SetPlayerHealth(playerid, health - 4); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 4); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 4); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 4); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 11); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 9); // Torso
- case 4: SetPlayerArmour(playerid, armour - 7); // Groin
- case 5: SetPlayerArmour(playerid, armour - 4); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 4); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 4); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 4); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 11); // Head
- }
- }
- }
- }
- case 29: // MP5
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 12); // Torso
- case 4: SetPlayerHealth(playerid, health - 9); // Groin
- case 5: SetPlayerHealth(playerid, health - 6); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 6); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 6); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 6); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 16); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 12); // Torso
- case 4: SetPlayerArmour(playerid, armour - 9); // Groin
- case 5: SetPlayerArmour(playerid, armour - 6); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 6); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 6); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 6); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 16); // Head
- }
- }
- }
- }
- case 30: // AK-47
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 20); // Torso
- case 4: SetPlayerHealth(playerid, health - 15); // Groin
- case 5: SetPlayerHealth(playerid, health - 8); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 8); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 8); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 8); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 25); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 20); // Torso
- case 4: SetPlayerArmour(playerid, armour - 15); // Groin
- case 5: SetPlayerArmour(playerid, armour - 8); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 8); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 8); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 8); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 25); // Head
- }
- }
- }
- }
- case 31: // M4
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 15); // Torso
- case 4: SetPlayerHealth(playerid, health - 12); // Groin
- case 5: SetPlayerHealth(playerid, health - 8); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 8); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 8); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 8); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 20); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 15); // Torso
- case 4: SetPlayerArmour(playerid, armour - 12); // Groin
- case 5: SetPlayerArmour(playerid, armour - 8); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 8); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 8); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 8); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 20); // Head
- }
- }
- }
- }
- case 32: // Tec-9
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 9); // Torso
- case 4: SetPlayerHealth(playerid, health - 7); // Groin
- case 5: SetPlayerHealth(playerid, health - 4); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 4); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 4); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 4); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 11); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 9); // Torso
- case 4: SetPlayerArmour(playerid, armour - 7); // Groin
- case 5: SetPlayerArmour(playerid, armour - 4); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 4); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 4); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 4); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 11); // Head
- }
- }
- }
- }
- case 33: // County Rifle
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 40); // Torso
- case 4: SetPlayerHealth(playerid, health - 35); // Groin
- case 5: SetPlayerHealth(playerid, health - 10); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 10); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 15); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 15); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 70); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 25); // Torso
- case 4: SetPlayerArmour(playerid, armour - 15); // Groin
- case 5: SetPlayerArmour(playerid, armour - 8); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 8); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 12); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 12); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 40); // Head
- }
- }
- }
- }
- case 34: // Sniper Rifle
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 70); // Torso
- case 4: SetPlayerHealth(playerid, health - 40); // Groin
- case 5: SetPlayerHealth(playerid, health - 15); // Left Arm
- case 6: SetPlayerHealth(playerid, health - 15); // Right Arm
- case 7: SetPlayerHealth(playerid, health - 15); // Left Leg
- case 8: SetPlayerHealth(playerid, health - 15); // Right Leg
- case 9: SetPlayerHealth(playerid, health - 100); // Head
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 35); // Torso
- case 4: SetPlayerArmour(playerid, armour - 20); // Groin
- case 5: SetPlayerArmour(playerid, armour - 7); // Left Arm
- case 6: SetPlayerArmour(playerid, armour - 7); // Right Arm
- case 7: SetPlayerArmour(playerid, armour - 7); // Left Leg
- case 8: SetPlayerArmour(playerid, armour - 7); // Right Leg
- case 9: SetPlayerArmour(playerid, armour - 50); // Head
- }
- }
- }
- }
- case 37: // Fire
- {
- SetPlayerHealth(playerid, health - 1);
- }
- case 38: // Minigun
- {
- SetPlayerHealth(playerid, health - 5);
- }
- case 41: // Spraycan
- {
- SetPlayerHealth(playerid, health - 0);
- }
- case 42: // Fire Extinguisher
- {
- SetPlayerHealth(playerid, health - 0);
- }
- case 46: // parachute
- {
- SetPlayerHealth(playerid, health - 5);
- }
- case 51: // Explosions
- {
- SetPlayerHealth(playerid, health - 75);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment