FlacoBey

Untitled

May 24th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 19.12 KB | None | 0 0
  1. #include <sourcemod>
  2. #include <sdktools>
  3. #include <sdkhooks>
  4.  
  5. #pragma tabsize 0
  6.  
  7. float EVERYONEAutoShot
  8. float EVERYONEHuntingRifle
  9. float EVERYONEPistol
  10. float EVERYONEMagnum
  11. float EVERYONEDesert
  12. float EVERYONEMilitary
  13. float EVERYONEScout
  14. float EVERYONEAwp
  15. float EVERYONESpas
  16. float EVERYONESmg
  17. float EVERYONESilenced
  18. float EVERYONESSG552
  19. float EVERYONESSG
  20. float EVERYONERifle
  21. float EVERYONEAk47
  22. float EVERYONEM60
  23. float EVERYONEPumpshotgun
  24. float EVERYONEChrome
  25.  
  26. float HeadEveryOneAutoShot
  27. float HeadEveryOneHuntingRifle
  28. float HeadEveryOnePistol
  29. float HeadEveryOneMagnum
  30. float HeadEveryOneDesert
  31. float HeadEveryOneMilitary
  32. float HeadEveryOneScout
  33. float HeadEveryOneAwp
  34. float HeadEveryOneSpas
  35. float HeadEveryOneSmg
  36. float HeadEveryOneSilenced
  37. float HeadEveryOneSSG552
  38. float HeadEveryOneSSG
  39. float HeadEveryOneRifle
  40. float HeadEveryOneAk47
  41. float HeadEveryOneM60
  42. float HeadEveryOnePumpshotgun
  43. float HeadEveryOneChrome
  44.  
  45. float TankAutoShot
  46. float TankHuntingRifle
  47. float TankPistol
  48. float TankMagnum
  49. float TankDesert
  50. float TankMilitary
  51. float TankScout
  52. float TankAwp
  53. float TankSpas
  54. float TankSmg
  55. float TankSilenced
  56. float TankSSG552
  57. float TankSSG
  58. float TankRifle
  59. float TankAk47
  60. float TankM60
  61. float TankPumpshotgun
  62. float TankChrome
  63.  
  64. float HEADAutoShot
  65. float HEADHuntingRifle
  66. float HEADPistol
  67. float HEADMagnum
  68. float HEADDesert
  69. float HEADMilitary
  70. float HEADScout
  71. float HEADAwp
  72. float HEADSpas
  73. float HEADSmg
  74. float HEADSilenced
  75. float HEADSSG552
  76. float HEADSSG
  77. float HEADRifle
  78. float HEADAk47
  79. float HEADM60
  80. float HEADPumpshotgun
  81. float HEADChrome
  82.  
  83. float HeadChargerAutoShot
  84. float HeadChargerHuntingRifle
  85. float HeadChargerPistol
  86. float HeadChargerMagnum
  87. float HeadChargerDesert
  88. float HeadChargerMilitary
  89. float HeadChargerScout
  90. float HeadChargerAwp
  91. float HeadChargerSpas
  92. float HeadChargerSmg
  93. float HeadChargerSilenced
  94. float HeadChargerSSG552
  95. float HeadChargerSSG
  96. float HeadChargerRifle
  97. float HeadChargerAk47
  98. float HeadChargerM60
  99. float HeadChargerPumpshotgun
  100. float HeadChargerChrome
  101.  
  102. float ChargerAutoShot
  103. float ChargerHuntingRifle
  104. float ChargerPistol
  105. float ChargerMagnum
  106. float ChargerDesert
  107. float ChargerMilitary
  108. float ChargerScout
  109. float ChargerAwp
  110. float ChargerSpas
  111. float ChargerSmg
  112. float ChargerSilenced
  113. float ChargerSSG552
  114. float ChargerSSG
  115. float ChargerRifle
  116. float ChargerAk47
  117. float ChargerM60
  118. float ChargerPumpshotgun
  119. float ChargerChrome
  120.  
  121. new bool:lateLoad;
  122.  
  123. public APLRes:AskPluginLoad2(Handle:plugin, bool:late, String:error[], errMax)
  124. {
  125.     lateLoad = late;
  126.     return APLRes_Success;    
  127. }
  128.  
  129. public OnPluginStart()
  130. {
  131.     if (lateLoad)
  132.     {
  133.         for (new client = 1; client <= MaxClients; client++)
  134.         {
  135.             if (IsClientInGame(client))
  136.             {
  137.                 OnClientPutInServer(client);
  138.             }
  139.         }
  140.     }
  141. }
  142.  
  143. public OnClientPutInServer(client)
  144. {
  145.     SDKHook(client, SDKHook_TraceAttack, OnTakeDamage);
  146. }
  147.  
  148. public OnClientDisconnect(client)
  149. {
  150.     SDKUnhook(client, SDKHook_TraceAttack, OnTakeDamage);
  151. }
  152.  
  153. public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, hitgroup)
  154. {
  155.     if (!(damagetype & DMG_BURN || damagetype & DMG_BLAST))
  156.     {
  157.         if (IsValidClient(attacker) && GetClientTeam(attacker) != 3)
  158.         {
  159.             if(IsValidClient(victim) && GetClientTeam(victim) != 2)
  160.             {
  161.                 int iEnt = GetEntPropEnt(attacker, Prop_Send, "m_hUseEntity");
  162.                 if(!IsValidEdict(iEnt) || iEnt < 0) return Plugin_Continue;
  163.                 char sWeaponEx[32]
  164.                 GetEdictClassname(iEnt, sWeaponEx, sizeof(sWeaponEx));
  165.                 if (StrEqual(sWeaponEx, "prop_minigun") || StrEqual(sWeaponEx, "prop_minigun_l4d1")) return Plugin_Continue;
  166.                
  167.                 decl String:classname[64];
  168.                 GetClientWeapon(attacker, classname, sizeof(classname));
  169.                 if(StrEqual(classname, "weapon_melee")) return Plugin_Continue;
  170.                
  171.                 int vClass = GetEntProp(victim, Prop_Send, "m_zombieClass")
  172.                
  173.                 if(vClass < 6)
  174.                 {
  175.                     if(StrEqual(classname, "weapon_autoshotgun"))
  176.                     {
  177.                         damage = EVERYONEAutoShot
  178.                         if(hitgroup == 1)
  179.                         {
  180.                             damage = HeadEveryOneAutoShot
  181.                         }
  182.                     }
  183.                     else if(StrEqual(classname, "weapon_hunting_rifle"))
  184.                     {
  185.                         damage = EVERYONEHuntingRifle
  186.                         if(hitgroup == 1)
  187.                         {
  188.                             damage = HeadEveryOneHuntingRifle
  189.                         }
  190.                     }
  191.                     else if(StrEqual(classname, "weapon_rifle"))
  192.                     {
  193.                         damage = EVERYONERifle
  194.                         if(hitgroup == 1)
  195.                         {
  196.                             damage = HeadEveryOneRifle
  197.                         }
  198.                     }
  199.                     else if(StrEqual(classname, "weapon_pistol"))
  200.                     {
  201.                         damage = EVERYONEPistol
  202.                         if(hitgroup == 1)
  203.                         {
  204.                             damage = HeadEveryOnePistol
  205.                         }
  206.                     }
  207.                     else if(StrEqual(classname, "weapon_pistol_magnum"))
  208.                     {
  209.                         damage = EVERYONEMagnum
  210.                         if(hitgroup == 1)
  211.                         {
  212.                             damage = HeadEveryOneMagnum
  213.                         }
  214.                     }
  215.                     else if(StrEqual(classname, "weapon_pumpshotgun"))
  216.                     {
  217.                         damage = EVERYONEPumpshotgun
  218.                         if(hitgroup == 1)
  219.                         {
  220.                             damage = HeadEveryOnePumpshotgun
  221.                         }
  222.                     }
  223.                     else if(StrEqual(classname, "weapon_rifle_ak47"))
  224.                     {
  225.                         damage = EVERYONEAk47
  226.                         if(hitgroup == 1)
  227.                         {
  228.                             damage = HeadEveryOneAk47
  229.                         }
  230.                     }
  231.                     else if(StrEqual(classname, "weapon_rifle_desert"))
  232.                     {
  233.                         damage = EVERYONEDesert
  234.                         if(hitgroup == 1)
  235.                         {
  236.                             damage = HeadEveryOneDesert
  237.                         }
  238.                     }
  239.                     else if(StrEqual(classname, "weapon_rifle_m60"))
  240.                     {
  241.                         damage = EVERYONEM60
  242.                         if(hitgroup == 1)
  243.                         {
  244.                             damage = HeadEveryOneM60
  245.                         }
  246.                     }
  247.                     else if(StrEqual(classname, "weapon_rifle_sg552"))
  248.                     {
  249.                         damage = EVERYONESSG552
  250.                         if(hitgroup == 1)
  251.                         {
  252.                             damage = HeadEveryOneSSG552
  253.                         }
  254.                     }
  255.                     else if(StrEqual(classname, "weapon_shotgun_chrome"))
  256.                     {
  257.                         damage = EVERYONEChrome
  258.                         if(hitgroup == 1)
  259.                         {
  260.                             damage = HeadEveryOneChrome
  261.                         }
  262.                     }
  263.                     else if(StrEqual(classname, "weapon_shotgun_spas"))
  264.                     {
  265.                         damage = EVERYONESpas
  266.                         if(hitgroup == 1)
  267.                         {
  268.                             damage = HeadEveryOneSpas
  269.                         }
  270.                     }
  271.                     else if(StrEqual(classname, "weapon_smg"))
  272.                     {
  273.                         damage = EVERYONESmg
  274.                         if(hitgroup == 1)
  275.                         {
  276.                             damage = HeadEveryOneSmg
  277.                         }
  278.                     }
  279.                     else if(StrEqual(classname, "weapon_smg_mp5"))
  280.                     {
  281.                         damage = EVERYONESSG
  282.                         if(hitgroup == 1)
  283.                         {
  284.                             damage = HeadEveryOneSSG
  285.                         }
  286.                     }
  287.                     else if(StrEqual(classname, "weapon_smg_silenced"))
  288.                     {
  289.                         damage = EVERYONESilenced
  290.                         if(hitgroup == 1)
  291.                         {
  292.                             damage = HeadEveryOneSilenced
  293.                         }
  294.                     }
  295.                     else if(StrEqual(classname, "weapon_sniper_awp"))
  296.                     {
  297.                         damage = EVERYONEAwp
  298.                         if(hitgroup == 1)
  299.                         {
  300.                             damage = HeadEveryOneAwp
  301.                         }
  302.                     }
  303.                     else if(StrEqual(classname, "weapon_sniper_scout"))
  304.                     {
  305.                         damage = EVERYONEScout
  306.                         if(hitgroup == 1)
  307.                         {
  308.                             damage = HeadEveryOneScout
  309.                         }
  310.                     }
  311.                     else if(StrEqual(classname, "weapon_sniper_military"))
  312.                     {
  313.                         damage = EVERYONEMilitary
  314.                         if(hitgroup == 1)
  315.                         {
  316.                             damage = HeadEveryOneMilitary
  317.                         }
  318.                     }
  319.                     return Plugin_Changed;
  320.                 }
  321.                 else if(vClass == 6)
  322.                 {
  323.                     if(StrEqual(classname, "weapon_autoshotgun"))
  324.                     {
  325.                         damage = ChargerAutoShot
  326.                         if(hitgroup == 1)
  327.                         {
  328.                             damage = HeadChargerAutoShot
  329.                         }
  330.                     }
  331.                     else if(StrEqual(classname, "weapon_hunting_rifle"))
  332.                     {
  333.                         damage = ChargerHuntingRifle
  334.                         if(hitgroup == 1)
  335.                         {
  336.                             damage = HeadChargerHuntingRifle
  337.                         }
  338.                     }
  339.                     else if(StrEqual(classname, "weapon_rifle"))
  340.                     {
  341.                         damage = ChargerRifle
  342.                         if(hitgroup == 1)
  343.                         {
  344.                             damage = HeadChargerRifle
  345.                         }
  346.                     }
  347.                     else if(StrEqual(classname, "weapon_pistol"))
  348.                     {
  349.                         damage = ChargerPistol
  350.                         if(hitgroup == 1)
  351.                         {
  352.                             damage = HeadChargerPistol
  353.                         }
  354.                     }
  355.                     else if(StrEqual(classname, "weapon_pistol_magnum"))
  356.                     {
  357.                         damage = ChargerMagnum
  358.                         if(hitgroup == 1)
  359.                         {
  360.                             damage = HeadChargerMagnum
  361.                         }
  362.                     }
  363.                     else if(StrEqual(classname, "weapon_pumpshotgun"))
  364.                     {
  365.                         damage = ChargerPumpshotgun
  366.                         if(hitgroup == 1)
  367.                         {
  368.                             damage = HeadChargerPumpshotgun
  369.                         }
  370.                     }
  371.                     else if(StrEqual(classname, "weapon_rifle_ak47"))
  372.                     {
  373.                         damage = ChargerAk47
  374.                         if(hitgroup == 1)
  375.                         {
  376.                             damage = HeadChargerAk47
  377.                         }
  378.                     }
  379.                     else if(StrEqual(classname, "weapon_rifle_desert"))
  380.                     {
  381.                         damage = ChargerDesert
  382.                         if(hitgroup == 1)
  383.                         {
  384.                             damage = HeadChargerDesert
  385.                         }
  386.                     }
  387.                     else if(StrEqual(classname, "weapon_rifle_m60"))
  388.                     {
  389.                         damage = ChargerM60
  390.                         if(hitgroup == 1)
  391.                         {
  392.                             damage = HeadChargerM60
  393.                         }
  394.                     }
  395.                     else if(StrEqual(classname, "weapon_rifle_sg552"))
  396.                     {
  397.                         damage = ChargerSSG552
  398.                         if(hitgroup == 1)
  399.                         {
  400.                             damage = HeadChargerSSG552
  401.                         }
  402.                     }
  403.                     else if(StrEqual(classname, "weapon_shotgun_chrome"))
  404.                     {
  405.                         damage = ChargerChrome
  406.                         if(hitgroup == 1)
  407.                         {
  408.                             damage = HeadChargerChrome
  409.                         }
  410.                     }
  411.                     else if(StrEqual(classname, "weapon_shotgun_spas"))
  412.                     {
  413.                         damage = ChargerSpas
  414.                         if(hitgroup == 1)
  415.                         {
  416.                             damage = HeadChargerSpas
  417.                         }
  418.                     }
  419.                     else if(StrEqual(classname, "weapon_smg"))
  420.                     {
  421.                         damage = ChargerSmg
  422.                         if(hitgroup == 1)
  423.                         {
  424.                             damage = HeadChargerSmg
  425.                         }
  426.                     }
  427.                     else if(StrEqual(classname, "weapon_smg_mp5"))
  428.                     {
  429.                         damage = ChargerSSG
  430.                         if(hitgroup == 1)
  431.                         {
  432.                             damage = HeadChargerSSG
  433.                         }
  434.                     }
  435.                     else if(StrEqual(classname, "weapon_smg_silenced"))
  436.                     {
  437.                         damage = ChargerSilenced
  438.                         if(hitgroup == 1)
  439.                         {
  440.                             damage = HeadChargerSilenced
  441.                         }
  442.                     }
  443.                     else if(StrEqual(classname, "weapon_sniper_awp"))
  444.                     {
  445.                         damage = ChargerAwp
  446.                         if(hitgroup == 1)
  447.                         {
  448.                             damage = HeadChargerAwp
  449.                         }
  450.                     }
  451.                     else if(StrEqual(classname, "weapon_sniper_scout"))
  452.                     {
  453.                         damage = ChargerScout
  454.                         if(hitgroup == 1)
  455.                         {
  456.                             damage = HeadChargerScout
  457.                         }
  458.                     }
  459.                     else if(StrEqual(classname, "weapon_sniper_military"))
  460.                     {
  461.                         damage = ChargerMilitary
  462.                         if(hitgroup == 1)
  463.                         {
  464.                             damage = HeadChargerMilitary
  465.                         }
  466.                     }
  467.                     return Plugin_Changed;
  468.                 }
  469.                 else if(vClass == 8)
  470.                 {
  471.  
  472.                     if(StrEqual(classname, "weapon_autoshotgun"))
  473.                     {
  474.                         damage = TankAutoShot
  475.                         if(hitgroup == 1)
  476.                         {
  477.                             damage = HEADAutoShot
  478.                         }
  479.                     }
  480.                     else if(StrEqual(classname, "weapon_hunting_rifle"))
  481.                     {
  482.                         damage = TankHuntingRifle
  483.                         if(hitgroup == 1)
  484.                         {
  485.                             damage = HEADHuntingRifle
  486.                         }
  487.                     }
  488.                     else if(StrEqual(classname, "weapon_rifle"))
  489.                     {
  490.                         damage = TankRifle
  491.                         if(hitgroup == 1)
  492.                         {
  493.                             damage = HEADRifle
  494.                         }
  495.                     }
  496.                     else if(StrEqual(classname, "weapon_pistol"))
  497.                     {
  498.                         damage = TankPistol
  499.                         if(hitgroup == 1)
  500.                         {
  501.                             damage = HEADPistol
  502.                         }
  503.                     }
  504.                     else if(StrEqual(classname, "weapon_pistol_magnum"))
  505.                     {
  506.                         damage = TankMagnum
  507.                         if(hitgroup == 1)
  508.                         {
  509.                             damage = HEADMagnum
  510.                         }
  511.                     }
  512.                     else if(StrEqual(classname, "weapon_pumpshotgun"))
  513.                     {
  514.                         damage = TankPumpshotgun
  515.                         if(hitgroup == 1)
  516.                         {
  517.                             damage = HEADPumpshotgun
  518.                         }
  519.                     }
  520.                     else if(StrEqual(classname, "weapon_rifle_ak47"))
  521.                     {
  522.                         damage = TankAk47
  523.                         if(hitgroup == 1)
  524.                         {
  525.                             damage = HEADAk47
  526.                         }
  527.                     }
  528.                     else if(StrEqual(classname, "weapon_rifle_desert"))
  529.                     {
  530.                         damage = TankDesert
  531.                         if(hitgroup == 1)
  532.                         {
  533.                             damage = HEADDesert
  534.                         }
  535.                     }
  536.                     else if(StrEqual(classname, "weapon_rifle_m60"))
  537.                     {
  538.                         damage = TankM60
  539.                         if(hitgroup == 1)
  540.                         {
  541.                             damage = HEADM60
  542.                         }
  543.                     }
  544.                     else if(StrEqual(classname, "weapon_rifle_sg552"))
  545.                     {
  546.                         damage = TankSSG552
  547.                         if(hitgroup == 1)
  548.                         {
  549.                             damage = HEADSSG552
  550.                         }
  551.                     }
  552.                     else if(StrEqual(classname, "weapon_shotgun_chrome"))
  553.                     {
  554.                         damage = TankChrome
  555.                         if(hitgroup == 1)
  556.                         {
  557.                             damage = HEADChrome
  558.                         }
  559.                     }
  560.                     else if(StrEqual(classname, "weapon_shotgun_spas"))
  561.                     {
  562.                         damage = TankSpas
  563.                         if(hitgroup == 1)
  564.                         {
  565.                             damage = HEADSpas
  566.                         }
  567.                     }
  568.                     else if(StrEqual(classname, "weapon_smg"))
  569.                     {
  570.                         damage = TankSmg
  571.                         if(hitgroup == 1)
  572.                         {
  573.                             damage = HEADSmg
  574.                         }
  575.                     }
  576.                     else if(StrEqual(classname, "weapon_smg_mp5"))
  577.                     {
  578.                         damage = TankSSG
  579.                         if(hitgroup == 1)
  580.                         {
  581.                             damage = HEADSSG
  582.                         }
  583.                     }
  584.                     else if(StrEqual(classname, "weapon_smg_silenced"))
  585.                     {
  586.                         damage = TankSilenced
  587.                         if(hitgroup == 1)
  588.                         {
  589.                             damage = HEADSilenced
  590.                         }
  591.                     }
  592.                     else if(StrEqual(classname, "weapon_sniper_awp"))
  593.                     {
  594.                         damage = TankAwp
  595.                         if(hitgroup == 1)
  596.                         {
  597.                             damage = HEADAwp
  598.                         }
  599.                     }
  600.                     else if(StrEqual(classname, "weapon_sniper_scout"))
  601.                     {
  602.                         damage = TankScout
  603.                         if(hitgroup == 1)
  604.                         {
  605.                             damage = HEADScout
  606.                         }
  607.                     }
  608.                     else if(StrEqual(classname, "weapon_sniper_military"))
  609.                     {
  610.                         damage = TankMilitary
  611.                         if(hitgroup == 1)
  612.                         {
  613.                             damage = HEADMilitary
  614.                         }
  615.                     }
  616.                     return Plugin_Changed;
  617.                 }
  618.             }
  619.         }
  620.     }
  621.     return Plugin_Continue;
  622. }
  623.  
  624. public IsValidClient(client)
  625. {
  626.     if (client <= 0)
  627.         return false;
  628.        
  629.     if (client > MaxClients)
  630.         return false;
  631.        
  632.     if (!IsClientInGame(client))
  633.         return false;
  634.        
  635.     if (!IsPlayerAlive(client))
  636.         return false;
  637.  
  638.     return true;
  639. }
Advertisement
Add Comment
Please, Sign In to add comment