ItsMods

Full Version: Anti Hitmarkers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi everyone!

At first sorry for my bad english, i'm swiss.
I would like to release this little plugin i made for my server.
I made it because i hate hitmarkers with the snipers Angel
You can set a list of weapons that will never do hitmarkers, it will always kill the victim.

Add those lines to the sv_config.ini:
Code:
[AntiHitMarkers]
Enabled=1
// 0 or 1
Weapon_list=iw5_msr iw5_l96a1
// Weapons list separated by 1 space

Plugin Csharp source code:
CSHARP Code
  1. using System;
  2.  
  3. using Addon;
  4.  
  5. namespace AntiHitMarkers
  6. {
  7. public class AntiHitMarkers : CPlugin
  8. {
  9. // List of weapons without hitmarkers
  10. private string[] weapon_list;
  11. // Status of the plugin
  12. private string enabled = "0";
  13.  
  14. public override void OnServerLoad()
  15. {
  16. // Get the status of the plugin
  17. enabled = GetServerCFG("AntiHitMarkers", "Enabled", "no_weapon");
  18.  
  19. // If the plugin is enabled
  20. if (enabled == "1")
  21. {
  22. // Get the list of antihitmarkers weapons
  23. string get_weapon_list = GetServerCFG("AntiHitMarkers", "Weapon_list", "no_weapon");
  24. // Split the list by spaces to get an array
  25. weapon_list = get_weapon_list.Split(' ');
  26. }
  27.  
  28. // Print plugin loaded
  29. ServerPrint("Plugin AntiHitMarkers loaded! (enabled => " + enabled + ")");
  30. }
  31.  
  32. public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, String Weapon, int Damage)
  33. {
  34. // If the plugin is enabled
  35. if (enabled == "1")
  36. {
  37. // Loop the weapons list
  38. foreach (string weapon_name in weapon_list)
  39. {
  40. // Control if the weapon is in the weapons list
  41. if (Weapon.Contains(weapon_name))
  42. {
  43. // If damage is lower than the victim's health
  44. if (Damage < Victim.Other.Health)
  45. {
  46. // Set the damage equal to the victim's health
  47. Damage = Victim.Other.Health;
  48. }
  49. // Stop the foreach
  50. break;
  51. }
  52. }
  53. }
  54. // Return the final damage
  55. return Damage;
  56. }
  57. }
  58. }


I'm open for every suggestions or comments.
Have Fun!
Really good release indeed. I myself actually like hitmarkers, but for people searching for real hardcore this might be VERY helpful. GJ Awesome
So instead of preventing any random bullet spam because people see hitmarkers you reward them with insta kill on those weapons? Well, if you like it, you may install that on your server.
Those weapons will become OP as shit.
Just sayin'
this does give me an idea for an instagib mod Big Grin
Hey,

thanks for this plugin by the way.
Its quite useful on a sniperserver but we've encourtered a bug.
At 15000 points at Team Deathmatch, the round wont end, this happens very very rarely (every 40th round?).
Nobody is making damage until you start another map, then everything is working fine again.

Cheers.

EDIT: Sorry, this plugin wasnt the reason of this bug.