Guest User

Untitled

a guest
Aug 23rd, 2016
1,076
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 26.68 KB | None | 0 0
  1. /////////////////////////////////////
  2. //        SAINT'S CUSTOM DAMAGE    //
  3. /////////////////////////////////////
  4.  
  5. #define FILTERSCRIPT
  6.  
  7. #include <a_samp>
  8.  
  9. #define BODY_PART_TORSO (3)
  10. #define BODY_PART_GROIN (4)
  11. #define BODY_PART_LEFT_ARM (5)
  12. #define BODY_PART_RIGHT_ARM (6)
  13. #define BODY_PART_LEFT_LEG (7)
  14. #define BODY_PART_RIGHT_LEG (8)
  15. #define BODY_PART_HEAD (9)
  16.  
  17. #define MAX_WEAPONS 55
  18. #define MAX_BODY_PARTS 7
  19.  
  20. #if defined FILTERSCRIPT
  21.  
  22. public OnFilterScriptInit()
  23. {
  24.     print("\n--------------------------------------");
  25.     print("   Custom Damage Filterscript by Saint  ");
  26.     print("--------------------------------------\n");
  27.     return 1;
  28. }
  29.  
  30. public OnFilterScriptExit()
  31. {
  32.     return 1;
  33. }
  34.  
  35. #endif
  36.  
  37. public OnPlayerConnect(playerid)
  38. {
  39.     SetPlayerTeam(playerid, 0);
  40.     return 1;
  41. }
  42.  
  43. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  44. {
  45.     new Float: health;
  46.     new Float: armour;
  47.     GetPlayerHealth(playerid, health);
  48.     GetPlayerArmour(playerid, armour);
  49.     if(issuerid != INVALID_PLAYER_ID)
  50.     {
  51.         if(weaponid == 0)
  52.         {
  53.             switch(armour)
  54.             {
  55.                 case 0:
  56.                 {
  57.                     switch(bodypart)
  58.                     {
  59.                         case 3: SetPlayerHealth(playerid, health - 5); // Torso.
  60.                         case 4: SetPlayerHealth(playerid, health - 5); // Groin.
  61.                         case 5: SetPlayerHealth(playerid, health - 5);  // Left Arm.
  62.                         case 6: SetPlayerHealth(playerid, health - 5); // Right Arm.
  63.                         case 7: SetPlayerHealth(playerid, health - 5);  // Left Leg.
  64.                         case 8: SetPlayerHealth(playerid, health - 5); // Right Leg.
  65.                         case 9: SetPlayerHealth(playerid, health - 5); // Head.
  66.                     }
  67.                 }
  68.                 default:
  69.                 {
  70.                     switch(bodypart)
  71.                     {
  72.                         case 3: SetPlayerHealth(playerid, health - 5); // Torso.
  73.                         case 4: SetPlayerHealth(playerid, health - 5); // Groin.
  74.                         case 5: SetPlayerHealth(playerid, health - 5);  // Left Arm.
  75.                         case 6: SetPlayerHealth(playerid, health - 5); // Right Arm.
  76.                         case 7: SetPlayerHealth(playerid, health - 5);  // Left Leg.
  77.                         case 8: SetPlayerHealth(playerid, health - 5); // Right Leg.
  78.                         case 9: SetPlayerHealth(playerid, health - 5); // Head.
  79.                     }
  80.                 }
  81.             }
  82.         }
  83.         else if(weaponid == 3)
  84.         {
  85.             switch(armour)
  86.             {
  87.                 case 0:
  88.                 {
  89.                     switch(bodypart)
  90.                     {
  91.                         case 3: SetPlayerHealth(playerid, health - 8); // Torso.
  92.                         case 4: SetPlayerHealth(playerid, health - 8); // Groin.
  93.                         case 5: SetPlayerHealth(playerid, health - 8);  // Left Arm.
  94.                         case 6: SetPlayerHealth(playerid, health - 8); // Right Arm.
  95.                         case 7: SetPlayerHealth(playerid, health - 8);  // Left Leg.
  96.                         case 8: SetPlayerHealth(playerid, health - 8); // Right Leg.
  97.                         case 9: SetPlayerHealth(playerid, health - 8); // Head.
  98.                     }
  99.                 }
  100.                 default:
  101.                 {
  102.                     switch(bodypart)
  103.                     {
  104.                         case 3: SetPlayerArmour(playerid, armour - 8); // Torso.
  105.                         case 4: SetPlayerArmour(playerid, armour - 8); // Groin.
  106.                         case 5: SetPlayerArmour(playerid, armour - 8);  // Left Arm.
  107.                         case 6: SetPlayerArmour(playerid, armour - 8); // Right Arm.
  108.                         case 7: SetPlayerArmour(playerid, armour - 8);  // Left Leg.
  109.                         case 8: SetPlayerArmour(playerid, armour - 8); // Right Leg.
  110.                         case 9: SetPlayerArmour(playerid, armour - 8); // Head.
  111.                     }
  112.                 }
  113.             }
  114.         }
  115.         else if(weaponid == 4)
  116.         {
  117.             switch(armour)
  118.             {
  119.                 case 0:
  120.                 {
  121.                     switch(bodypart)
  122.                     {
  123.                         case 3: SetPlayerHealth(playerid, health - 11); // Torso.
  124.                         case 4: SetPlayerHealth(playerid, health - 11); // Groin.
  125.                         case 5: SetPlayerHealth(playerid, health - 11);  // Left Arm.
  126.                         case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
  127.                         case 7: SetPlayerHealth(playerid, health - 11);  // Left Leg.
  128.                         case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
  129.                         case 9: SetPlayerHealth(playerid, health - 11); // Head.
  130.                     }
  131.                 }
  132.                 default:
  133.                 {
  134.                     switch(bodypart)
  135.                     {
  136.                         case 3: SetPlayerHealth(playerid, health - 11); // Torso.
  137.                         case 4: SetPlayerHealth(playerid, health - 11); // Groin.
  138.                         case 5: SetPlayerHealth(playerid, health - 11);  // Left Arm.
  139.                         case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
  140.                         case 7: SetPlayerHealth(playerid, health - 11);  // Left Leg.
  141.                         case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
  142.                         case 9: SetPlayerHealth(playerid, health - 11); // Head.
  143.                     }
  144.                 }
  145.             }
  146.         }
  147.         else if(weaponid == 5)
  148.         {
  149.             switch(armour)
  150.             {
  151.                 case 0:
  152.                 {
  153.                     switch(bodypart)
  154.                     {
  155.                         case 3: SetPlayerHealth(playerid, health - 11); // Torso.
  156.                         case 4: SetPlayerHealth(playerid, health - 11); // Groin.
  157.                         case 5: SetPlayerHealth(playerid, health - 11);  // Left Arm.
  158.                         case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
  159.                         case 7: SetPlayerHealth(playerid, health - 11);  // Left Leg.
  160.                         case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
  161.                         case 9: SetPlayerHealth(playerid, health - 11); // Head.
  162.                     }
  163.                 }
  164.                 default:
  165.                 {
  166.                     switch(bodypart)
  167.                     {
  168.                         case 3: SetPlayerHealth(playerid, health - 11); // Torso.
  169.                         case 4: SetPlayerHealth(playerid, health - 11); // Groin.
  170.                         case 5: SetPlayerHealth(playerid, health - 11);  // Left Arm.
  171.                         case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
  172.                         case 7: SetPlayerHealth(playerid, health - 11);  // Left Leg.
  173.                         case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
  174.                         case 9: SetPlayerHealth(playerid, health - 11); // Head.
  175.                     }
  176.                 }
  177.             }
  178.         }
  179.         else if(weaponid == 8)
  180.         {
  181.             switch(armour)
  182.             {
  183.                 case 0:
  184.                 {
  185.                     switch(bodypart)
  186.                     {
  187.                         case 3: SetPlayerHealth(playerid, health - 13); // Torso.
  188.                         case 4: SetPlayerHealth(playerid, health - 13); // Groin.
  189.                         case 5: SetPlayerHealth(playerid, health - 13);  // Left Arm.
  190.                         case 6: SetPlayerHealth(playerid, health - 13); // Right Arm.
  191.                         case 7: SetPlayerHealth(playerid, health - 13);  // Left Leg.
  192.                         case 8: SetPlayerHealth(playerid, health - 13); // Right Leg.
  193.                         case 9: SetPlayerHealth(playerid, health - 99); // Head.
  194.                     }
  195.                 }
  196.                 default:
  197.                 {
  198.                     switch(bodypart)
  199.                     {
  200.                         case 3: SetPlayerHealth(playerid, health - 13); // Torso.
  201.                         case 4: SetPlayerHealth(playerid, health - 13); // Groin.
  202.                         case 5: SetPlayerHealth(playerid, health - 13);  // Left Arm.
  203.                         case 6: SetPlayerHealth(playerid, health - 13); // Right Arm.
  204.                         case 7: SetPlayerHealth(playerid, health - 13);  // Left Leg.
  205.                         case 8: SetPlayerHealth(playerid, health - 13); // Right Leg.
  206.                         case 9: SetPlayerHealth(playerid, health - 99); // Head.
  207.                     }
  208.                 }
  209.             }
  210.         }
  211.         else if(weaponid == 22)
  212.         {
  213.             switch(armour)
  214.             {
  215.                 case 0:
  216.                 {
  217.                     switch(bodypart)
  218.                     {
  219.                         case 3: SetPlayerHealth(playerid, health - 15); // Torso.
  220.                         case 4: SetPlayerHealth(playerid, health - 15); // Groin.
  221.                         case 5: SetPlayerHealth(playerid, health - 15);  // Left Arm.
  222.                         case 6: SetPlayerHealth(playerid, health - 15); // Right Arm.
  223.                         case 7: SetPlayerHealth(playerid, health - 15);  // Left Leg.
  224.                         case 8: SetPlayerHealth(playerid, health - 15); // Right Leg.
  225.                         case 9: SetPlayerHealth(playerid, health - 45); // Head.
  226.                     }
  227.                 }
  228.                 default:
  229.                 {
  230.                     switch(bodypart)
  231.                     {
  232.                         case 3: SetPlayerHealth(playerid, health - 11); // Torso.
  233.                         case 4: SetPlayerHealth(playerid, health - 11); // Groin.
  234.                         case 5: SetPlayerHealth(playerid, health - 11);  // Left Arm.
  235.                         case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
  236.                         case 7: SetPlayerHealth(playerid, health - 11);  // Left Leg.
  237.                         case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
  238.                         case 9: SetPlayerHealth(playerid, health - 45); // Head.
  239.                     }
  240.                 }
  241.             }
  242.         }
  243.         else if(weaponid == 23)
  244.         {
  245.             switch(armour)
  246.             {
  247.                 case 0:
  248.                 {
  249.                     switch(bodypart)
  250.                     {
  251.                         case 3: SetPlayerHealth(playerid, health - 11); // Torso.
  252.                         case 4: SetPlayerHealth(playerid, health - 11); // Groin.
  253.                         case 5: SetPlayerHealth(playerid, health - 11);  // Left Arm.
  254.                         case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
  255.                         case 7: SetPlayerHealth(playerid, health - 11);  // Left Leg.
  256.                         case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
  257.                         case 9: SetPlayerHealth(playerid, health - 45); // Head.
  258.                     }
  259.                 }
  260.                 default:
  261.                 {
  262.                     switch(bodypart)
  263.                     {
  264.                         case 3: SetPlayerHealth(playerid, health - 11); // Torso.
  265.                         case 4: SetPlayerHealth(playerid, health - 11); // Groin.
  266.                         case 5: SetPlayerHealth(playerid, health - 11);  // Left Arm.
  267.                         case 6: SetPlayerHealth(playerid, health - 11); // Right Arm.
  268.                         case 7: SetPlayerHealth(playerid, health - 11);  // Left Leg.
  269.                         case 8: SetPlayerHealth(playerid, health - 11); // Right Leg.
  270.                         case 9: SetPlayerHealth(playerid, health - 45); // Head.
  271.                     }
  272.                 }
  273.             }
  274.         }
  275.         else if(weaponid == 24)
  276.         {
  277.             switch(armour)
  278.             {
  279.                 case 0:
  280.                 {
  281.                     switch(bodypart)
  282.                     {
  283.                         case 3: SetPlayerHealth(playerid, health - 25); // Torso.
  284.                         case 4: SetPlayerHealth(playerid, health - 20); // Groin.
  285.                         case 5: SetPlayerHealth(playerid, health - 10);  // Left Arm.
  286.                         case 6: SetPlayerHealth(playerid, health - 10); // Right Arm.
  287.                         case 7: SetPlayerHealth(playerid, health - 10);  // Left Leg.
  288.                         case 8: SetPlayerHealth(playerid, health - 10); // Right Leg.
  289.                         case 9: SetPlayerHealth(playerid, health - 50); // Head.
  290.                     }
  291.                 }
  292.                 default:
  293.                 {
  294.                     switch(bodypart)
  295.                     {
  296.                         case 3: SetPlayerArmour(playerid, armour - 13); // Torso.
  297.                         case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
  298.                         case 5: SetPlayerArmour(playerid, armour - 5);  // Left Arm.
  299.                         case 6: SetPlayerArmour(playerid, armour - 5); // Right Arm.
  300.                         case 7: SetPlayerArmour(playerid, armour - 5);  // Left Leg.
  301.                         case 8: SetPlayerArmour(playerid, armour - 5); // Right Leg.
  302.                         case 9: SetPlayerArmour(playerid, armour - 25); // Head.
  303.                     }
  304.                 }
  305.             }
  306.         }
  307.         else if(weaponid == 24)
  308.         {
  309.             switch(armour)
  310.             {
  311.                 case 0:
  312.                 {
  313.                     switch(bodypart)
  314.                     {
  315.                         case 3: SetPlayerHealth(playerid, health - 30); // Torso.
  316.                         case 4: SetPlayerHealth(playerid, health - 20); // Groin.
  317.                         case 5: SetPlayerHealth(playerid, health - 15);  // Left Arm.
  318.                         case 6: SetPlayerHealth(playerid, health - 15); // Right Arm.
  319.                         case 7: SetPlayerHealth(playerid, health - 15);  // Left Leg.
  320.                         case 8: SetPlayerHealth(playerid, health - 15); // Right Leg.
  321.                         case 9: SetPlayerHealth(playerid, health - 60); // Head.
  322.                     }
  323.                 }
  324.                 default:
  325.                 {
  326.                     switch(bodypart)
  327.                     {
  328.                         case 3: SetPlayerArmour(playerid, armour - 15); // Torso.
  329.                         case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
  330.                         case 5: SetPlayerArmour(playerid, armour - 8);  // Left Arm.
  331.                         case 6: SetPlayerArmour(playerid, armour - 8); // Right Arm.
  332.                         case 7: SetPlayerArmour(playerid, armour - 8);  // Left Leg.
  333.                         case 8: SetPlayerArmour(playerid, armour - 8); // Right Leg.
  334.                         case 9: SetPlayerArmour(playerid, armour - 40); // Head.
  335.                     }
  336.                 }
  337.             }
  338.         }
  339.         else if(weaponid == 25)
  340.         {
  341.             switch(armour) // Creates a switch that switches through the armour float, and checks the value.
  342.             {
  343.                 case 0: // If the value is 0, the codes underneath will activate.
  344.                 {
  345.                     switch(bodypart)
  346.                     {
  347.                         case 3: SetPlayerHealth(playerid, health - 40); // Torso.
  348.                         case 4: SetPlayerHealth(playerid, health - 20); // Groin.
  349.                         case 5: SetPlayerHealth(playerid, health - 15);  // Left Arm.
  350.                         case 6: SetPlayerHealth(playerid, health - 15); // Right Arm.
  351.                         case 7: SetPlayerHealth(playerid, health - 15);  // Left Leg.
  352.                         case 8: SetPlayerHealth(playerid, health - 15); // Right Leg.
  353.                         case 9: SetPlayerHealth(playerid, health - 100); // Head.
  354.                     }
  355.                 }
  356.                 default: // Otherwise the codes underneath will activate.
  357.                 {
  358.                     switch(bodypart)
  359.                     {
  360.                         case 3: SetPlayerArmour(playerid, armour - 20); // Torso.
  361.                         case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
  362.                         case 5: SetPlayerArmour(playerid, armour - 7);  // Left Arm.
  363.                         case 6: SetPlayerArmour(playerid, armour - 7); // Right Arm.
  364.                         case 7: SetPlayerArmour(playerid, armour - 7);  // Left Leg.
  365.                         case 8: SetPlayerArmour(playerid, armour - 7); // Right Leg.
  366.                         case 9: SetPlayerArmour(playerid, armour - 50); // Head.
  367.                     }
  368.                 }
  369.             }
  370.         }
  371.         else if(weaponid == 29)
  372.         {
  373.             switch(armour)
  374.             {
  375.                 case 0:
  376.                 {
  377.                     switch(bodypart)
  378.                     {
  379.                         case 3: SetPlayerHealth(playerid, health - 15); // Torso.
  380.                         case 4: SetPlayerHealth(playerid, health - 10); // Groin.
  381.                         case 5: SetPlayerHealth(playerid, health - 10);  // Left Arm.
  382.                         case 6: SetPlayerHealth(playerid, health - 10); // Right Arm.
  383.                         case 7: SetPlayerHealth(playerid, health - 10);  // Left Leg.
  384.                         case 8: SetPlayerHealth(playerid, health - 10); // Right Leg.
  385.                         case 9: SetPlayerHealth(playerid, health - 50); // Head.
  386.                     }
  387.                 }
  388.                 default:
  389.                 {
  390.                     switch(bodypart)
  391.                     {
  392.                         case 3: SetPlayerArmour(playerid, armour - 10); // Torso.
  393.                         case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
  394.                         case 5: SetPlayerArmour(playerid, armour - 5);  // Left Arm.
  395.                         case 6: SetPlayerArmour(playerid, armour - 5); // Right Arm.
  396.                         case 7: SetPlayerArmour(playerid, armour - 5);  // Left Leg.
  397.                         case 8: SetPlayerArmour(playerid, armour - 5); // Right Leg.
  398.                         case 9: SetPlayerArmour(playerid, armour - 25); // Head.
  399.                     }
  400.                 }
  401.             }
  402.         }
  403.         else if(weaponid == 30)
  404.         {
  405.             switch(armour) // Creates a switch that switches through the armour float, and checks the value.
  406.             {
  407.                 case 0: // If the value is 0, the codes underneath will activate.
  408.                 {
  409.                     switch(bodypart)
  410.                     {
  411.                         case 3: SetPlayerHealth(playerid, health - 35); // Torso.
  412.                         case 4: SetPlayerHealth(playerid, health - 35); // Groin.
  413.                         case 5: SetPlayerHealth(playerid, health - 20);  // Left Arm.
  414.                         case 6: SetPlayerHealth(playerid, health - 20); // Right Arm.
  415.                         case 7: SetPlayerHealth(playerid, health - 14);  // Left Leg.
  416.                         case 8: SetPlayerHealth(playerid, health - 14); // Right Leg.
  417.                         case 9: SetPlayerHealth(playerid, health - 50); // Head.
  418.                     }
  419.                 }
  420.                 default: // Otherwise the codes underneath will activate.
  421.                 {
  422.                     switch(bodypart)
  423.                     {
  424.                         case 3: SetPlayerArmour(playerid, armour - 15); // Torso.
  425.                         case 4: SetPlayerArmour(playerid, armour - 15); // Groin.
  426.                         case 5: SetPlayerArmour(playerid, armour - 10);  // Left Arm.
  427.                         case 6: SetPlayerArmour(playerid, armour - 10); // Right Arm.
  428.                         case 7: SetPlayerArmour(playerid, armour - 7);  // Left Leg.
  429.                         case 8: SetPlayerArmour(playerid, armour - 7); // Right Leg.
  430.                         case 9: SetPlayerArmour(playerid, armour - 50); // Head.
  431.                     }
  432.                 }
  433.             }
  434.         }
  435.         else if(weaponid == 31)
  436.         {
  437.             switch(armour) // Creates a switch that switches through the armour float, and checks the value.
  438.             {
  439.                 case 0: // If the value is 0, the codes underneath will activate.
  440.                 {
  441.                     switch(bodypart)
  442.                     {
  443.                         case 3: SetPlayerHealth(playerid, health - 20); // Torso.
  444.                         case 4: SetPlayerHealth(playerid, health - 20); // Groin.
  445.                         case 5: SetPlayerHealth(playerid, health - 10);  // Left Arm.
  446.                         case 6: SetPlayerHealth(playerid, health - 10); // Right Arm.
  447.                         case 7: SetPlayerHealth(playerid, health - 7);  // Left Leg.
  448.                         case 8: SetPlayerHealth(playerid, health - 7); // Right Leg.
  449.                         case 9: SetPlayerHealth(playerid, health - 100); // Head.
  450.                     }
  451.                 }
  452.                 default: // Otherwise the codes underneath will activate.
  453.                 {
  454.                     switch(bodypart)
  455.                     {
  456.                         case 3: SetPlayerArmour(playerid, armour - 10); // Torso.
  457.                         case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
  458.                         case 5: SetPlayerArmour(playerid, armour - 5);  // Left Arm.
  459.                         case 6: SetPlayerArmour(playerid, armour - 4); // Right Arm.
  460.                         case 7: SetPlayerArmour(playerid, armour - 4);  // Left Leg.
  461.                         case 8: SetPlayerArmour(playerid, armour - 4); // Right Leg.
  462.                         case 9: SetPlayerArmour(playerid, armour - 50); // Head.
  463.                     }
  464.                 }
  465.             }
  466.         }
  467.         else if(weaponid == 32)
  468.         {
  469.             switch(armour)
  470.             {
  471.                 case 0:
  472.                 {
  473.                     switch(bodypart)
  474.                     {
  475.                         case 3: SetPlayerHealth(playerid, health - 15); // Torso.
  476.                         case 4: SetPlayerHealth(playerid, health - 15); // Groin.
  477.                         case 5: SetPlayerHealth(playerid, health - 15);  // Left Arm.
  478.                         case 6: SetPlayerHealth(playerid, health - 15); // Right Arm.
  479.                         case 7: SetPlayerHealth(playerid, health - 15);  // Left Leg.
  480.                         case 8: SetPlayerHealth(playerid, health - 15); // Right Leg.
  481.                         case 9: SetPlayerHealth(playerid, health - 50); // Head.
  482.                     }
  483.                 }
  484.                 default:
  485.                 {
  486.                     switch(bodypart)
  487.                     {
  488.                         case 3: SetPlayerArmour(playerid, armour - 10); // Torso.
  489.                         case 4: SetPlayerArmour(playerid, armour - 10); // Groin.
  490.                         case 5: SetPlayerArmour(playerid, armour - 10);  // Left Arm.
  491.                         case 6: SetPlayerArmour(playerid, armour - 10); // Right Arm.
  492.                         case 7: SetPlayerArmour(playerid, armour - 10);  // Left Leg.
  493.                         case 8: SetPlayerArmour(playerid, armour - 10); // Right Leg.
  494.                         case 9: SetPlayerArmour(playerid, armour - 25); // Head.
  495.                     }
  496.                 }
  497.             }
  498.         }
  499.         else if(weaponid == 33)
  500.         {
  501.             switch(armour)
  502.             {
  503.                 case 0:
  504.                 {
  505.                     switch(bodypart)
  506.                     {
  507.                         case 3: SetPlayerHealth(playerid, health - 40); // Torso.
  508.                         case 4: SetPlayerHealth(playerid, health - 25); // Groin.
  509.                         case 5: SetPlayerHealth(playerid, health - 15);  // Left Arm.
  510.                         case 6: SetPlayerHealth(playerid, health - 15); // Right Arm.
  511.                         case 7: SetPlayerHealth(playerid, health - 15);  // Left Leg.
  512.                         case 8: SetPlayerHealth(playerid, health - 15); // Right Leg.
  513.                         case 9: SetPlayerHealth(playerid, health - 100); // Head.
  514.                     }
  515.                 }
  516.                 default:
  517.                 {
  518.                     switch(bodypart)
  519.                     {
  520.                         case 3: SetPlayerArmour(playerid, armour - 25); // Torso.
  521.                         case 4: SetPlayerArmour(playerid, armour - 15); // Groin.
  522.                         case 5: SetPlayerArmour(playerid, armour - 5);  // Left Arm.
  523.                         case 6: SetPlayerArmour(playerid, armour - 5); // Right Arm.
  524.                         case 7: SetPlayerArmour(playerid, armour - 5);  // Left Leg.
  525.                         case 8: SetPlayerArmour(playerid, armour - 5); // Right Leg.
  526.                         case 9: SetPlayerArmour(playerid, armour - 70); // Head.
  527.                     }
  528.                 }
  529.             }
  530.         }
  531.         else if(weaponid == 34)
  532.         {
  533.             switch(armour) // Creates a switch that switches through the armour float, and checks the value.
  534.             {
  535.                 case 0: // If the value is 0, the codes underneath will activate.
  536.                 {
  537.                     switch(bodypart)
  538.                     {
  539.                         case 3: SetPlayerHealth(playerid, health - 60); // Torso.
  540.                         case 4: SetPlayerHealth(playerid, health - 35); // Groin.
  541.                         case 5: SetPlayerHealth(playerid, health - 20);  // Left Arm.
  542.                         case 6: SetPlayerHealth(playerid, health - 20); // Right Arm.
  543.                         case 7: SetPlayerHealth(playerid, health - 20);  // Left Leg.
  544.                         case 8: SetPlayerHealth(playerid, health - 20); // Right Leg.
  545.                         case 9: SetPlayerHealth(playerid, health - 100); // Head.
  546.                     }
  547.                 }
  548.                 default: // Otherwise the codes underneath will activate.
  549.                 {
  550.                     switch(bodypart)
  551.                     {
  552.                         case 3: SetPlayerArmour(playerid, armour - 25); // Torso.
  553.                         case 4: SetPlayerArmour(playerid, armour - 15); // Groin.
  554.                         case 5: SetPlayerArmour(playerid, armour - 5);  // Left Arm.
  555.                         case 6: SetPlayerArmour(playerid, armour - 5); // Right Arm.
  556.                         case 7: SetPlayerArmour(playerid, armour - 5);  // Left Leg.
  557.                         case 8: SetPlayerArmour(playerid, armour - 5); // Right Leg.
  558.                         case 9: SetPlayerArmour(playerid, armour - 70); // Head.
  559.                     }
  560.                 }
  561.             }
  562.         }
  563.     }
  564.     return 1;
  565. }
Advertisement
Add Comment
Please, Sign In to add comment