Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////
- // SAINT'S CUSTOM DAMAGE //
- /////////////////////////////////////
- #define FILTERSCRIPT
- #include <a_samp>
- #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)
- #define MAX_WEAPONS 55
- #define MAX_BODY_PARTS 7
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Custom Damage Filterscript by Saint ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- #endif
- public OnPlayerConnect(playerid)
- {
- SetPlayerTeam(playerid, 0);
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
- {
- new Float: health;
- new Float: armour;
- GetPlayerHealth(playerid, health);
- GetPlayerArmour(playerid, armour);
- if(issuerid != INVALID_PLAYER_ID)
- {
- if(weaponid == 0)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 5); // Torso.
- case 4: SetPlayerHealth(playerid, health - 5); // Groin.
- case 5: SetPlayerHealth(playerid, health - 5); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 5); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 5); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 5); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 5); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 5); // Torso.
- case 4: SetPlayerHealth(playerid, health - 5); // Groin.
- case 5: SetPlayerHealth(playerid, health - 5); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 5); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 5); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 5); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 5); // Head.
- }
- }
- }
- }
- else if(weaponid == 3)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 8); // Torso.
- case 4: SetPlayerHealth(playerid, health - 8); // 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 - 8); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 8); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 8); // 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 - 8); // Head.
- }
- }
- }
- }
- else if(weaponid == 4)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 11); // Torso.
- case 4: SetPlayerHealth(playerid, health - 11); // Groin.
- case 5: SetPlayerHealth(playerid, health - 11); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 11); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 11); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 11); // Torso.
- case 4: SetPlayerHealth(playerid, health - 11); // Groin.
- case 5: SetPlayerHealth(playerid, health - 11); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 11); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 11); // Head.
- }
- }
- }
- }
- else if(weaponid == 5)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 11); // Torso.
- case 4: SetPlayerHealth(playerid, health - 11); // Groin.
- case 5: SetPlayerHealth(playerid, health - 11); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 11); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 11); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 11); // Torso.
- case 4: SetPlayerHealth(playerid, health - 11); // Groin.
- case 5: SetPlayerHealth(playerid, health - 11); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 11); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 11); // Head.
- }
- }
- }
- }
- else if(weaponid == 8)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 13); // Torso.
- case 4: SetPlayerHealth(playerid, health - 13); // Groin.
- case 5: SetPlayerHealth(playerid, health - 13); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 13); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 13); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 13); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 99); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 13); // Torso.
- case 4: SetPlayerHealth(playerid, health - 13); // Groin.
- case 5: SetPlayerHealth(playerid, health - 13); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 13); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 13); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 13); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 99); // Head.
- }
- }
- }
- }
- else if(weaponid == 22)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 15); // Torso.
- case 4: SetPlayerHealth(playerid, health - 15); // 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 - 45); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 11); // Torso.
- case 4: SetPlayerHealth(playerid, health - 11); // Groin.
- case 5: SetPlayerHealth(playerid, health - 11); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 11); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 45); // Head.
- }
- }
- }
- }
- else if(weaponid == 23)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 11); // Torso.
- case 4: SetPlayerHealth(playerid, health - 11); // Groin.
- case 5: SetPlayerHealth(playerid, health - 11); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 11); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 45); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 11); // Torso.
- case 4: SetPlayerHealth(playerid, health - 11); // Groin.
- case 5: SetPlayerHealth(playerid, health - 11); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 11); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 45); // Head.
- }
- }
- }
- }
- else if(weaponid == 24)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 25); // Torso.
- case 4: SetPlayerHealth(playerid, health - 20); // 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 - 50); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 13); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
- case 5: SetPlayerArmour(playerid, armour - 5); // Left Arm.
- case 6: SetPlayerArmour(playerid, armour - 5); // Right Arm.
- case 7: SetPlayerArmour(playerid, armour - 5); // Left Leg.
- case 8: SetPlayerArmour(playerid, armour - 5); // Right Leg.
- case 9: SetPlayerArmour(playerid, armour - 25); // Head.
- }
- }
- }
- }
- else if(weaponid == 24)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 30); // Torso.
- case 4: SetPlayerHealth(playerid, health - 20); // 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 - 60); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 15); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 10); // 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 - 40); // Head.
- }
- }
- }
- }
- else if(weaponid == 25)
- {
- switch(armour) // Creates a switch that switches through the armour float, and checks the value.
- {
- case 0: // If the value is 0, the codes underneath will activate.
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 40); // Torso.
- case 4: SetPlayerHealth(playerid, health - 20); // 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: // Otherwise the codes underneath will activate.
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 20); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 10); // 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.
- }
- }
- }
- }
- else if(weaponid == 29)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 15); // Torso.
- case 4: SetPlayerHealth(playerid, health - 10); // 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 - 50); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 10); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
- case 5: SetPlayerArmour(playerid, armour - 5); // Left Arm.
- case 6: SetPlayerArmour(playerid, armour - 5); // Right Arm.
- case 7: SetPlayerArmour(playerid, armour - 5); // Left Leg.
- case 8: SetPlayerArmour(playerid, armour - 5); // Right Leg.
- case 9: SetPlayerArmour(playerid, armour - 25); // Head.
- }
- }
- }
- }
- else if(weaponid == 30)
- {
- switch(armour) // Creates a switch that switches through the armour float, and checks the value.
- {
- case 0: // If the value is 0, the codes underneath will activate.
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 35); // Torso.
- case 4: SetPlayerHealth(playerid, health - 35); // Groin.
- case 5: SetPlayerHealth(playerid, health - 20); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 20); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 14); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 14); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 50); // Head.
- }
- }
- default: // Otherwise the codes underneath will activate.
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 15); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 15); // Groin.
- case 5: SetPlayerArmour(playerid, armour - 10); // Left Arm.
- case 6: SetPlayerArmour(playerid, armour - 10); // 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.
- }
- }
- }
- }
- else if(weaponid == 31)
- {
- switch(armour) // Creates a switch that switches through the armour float, and checks the value.
- {
- case 0: // If the value is 0, the codes underneath will activate.
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 20); // Torso.
- case 4: SetPlayerHealth(playerid, health - 20); // Groin.
- case 5: SetPlayerHealth(playerid, health - 10); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 10); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 7); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 7); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 100); // Head.
- }
- }
- default: // Otherwise the codes underneath will activate.
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 10); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
- case 5: SetPlayerArmour(playerid, armour - 5); // 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 - 50); // Head.
- }
- }
- }
- }
- else if(weaponid == 32)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 15); // Torso.
- case 4: SetPlayerHealth(playerid, health - 15); // 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 - 50); // Head.
- }
- }
- default:
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 10); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
- case 5: SetPlayerArmour(playerid, armour - 10); // Left Arm.
- case 6: SetPlayerArmour(playerid, armour - 10); // Right Arm.
- case 7: SetPlayerArmour(playerid, armour - 10); // Left Leg.
- case 8: SetPlayerArmour(playerid, armour - 10); // Right Leg.
- case 9: SetPlayerArmour(playerid, armour - 25); // Head.
- }
- }
- }
- }
- else if(weaponid == 33)
- {
- switch(armour)
- {
- case 0:
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 40); // Torso.
- case 4: SetPlayerHealth(playerid, health - 25); // 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 - 25); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 15); // Groin.
- case 5: SetPlayerArmour(playerid, armour - 5); // Left Arm.
- case 6: SetPlayerArmour(playerid, armour - 5); // Right Arm.
- case 7: SetPlayerArmour(playerid, armour - 5); // Left Leg.
- case 8: SetPlayerArmour(playerid, armour - 5); // Right Leg.
- case 9: SetPlayerArmour(playerid, armour - 70); // Head.
- }
- }
- }
- }
- else if(weaponid == 34)
- {
- switch(armour) // Creates a switch that switches through the armour float, and checks the value.
- {
- case 0: // If the value is 0, the codes underneath will activate.
- {
- switch(bodypart)
- {
- case 3: SetPlayerHealth(playerid, health - 60); // Torso.
- case 4: SetPlayerHealth(playerid, health - 35); // Groin.
- case 5: SetPlayerHealth(playerid, health - 20); // Left Arm.
- case 6: SetPlayerHealth(playerid, health - 20); // Right Arm.
- case 7: SetPlayerHealth(playerid, health - 20); // Left Leg.
- case 8: SetPlayerHealth(playerid, health - 20); // Right Leg.
- case 9: SetPlayerHealth(playerid, health - 100); // Head.
- }
- }
- default: // Otherwise the codes underneath will activate.
- {
- switch(bodypart)
- {
- case 3: SetPlayerArmour(playerid, armour - 25); // Torso.
- case 4: SetPlayerArmour(playerid, armour - 15); // Groin.
- case 5: SetPlayerArmour(playerid, armour - 5); // Left Arm.
- case 6: SetPlayerArmour(playerid, armour - 5); // Right Arm.
- case 7: SetPlayerArmour(playerid, armour - 5); // Left Leg.
- case 8: SetPlayerArmour(playerid, armour - 5); // Right Leg.
- case 9: SetPlayerArmour(playerid, armour - 70); // Head.
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment