Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Anti Hitmarkers
07-13-2012, 19:33 (This post was last modified: 07-28-2012 12:55 by narkos.)
Post: #1
Anti Hitmarkers
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!
Related links


Attached File(s)
.zip  AntiHitMarkers.zip (Size: 2.07 KB / Downloads: 79)
Find all posts by this user
Add Thank You Quote this message in a reply
[-] The following 6 users say Thank You to narkos for this post:
Daintin (08-23-2012), G-Man (07-13-2012), jakata (07-17-2012), JariZ (07-14-2012), Pozzuh (07-13-2012), surtek (07-13-2012)
07-13-2012, 21:02
Post: #2
RE: Anti Hitmarkers
Really good release indeed. I myself actually like hitmarkers, but for people searching for real hardcore this might be VERY helpful. GJ Awesome

[Image: rainbow%20mustache.gif]
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
07-13-2012, 21:13
Post: #3
RE: Anti Hitmarkers
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.

Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
07-14-2012, 00:30
Post: #4
RE: Anti Hitmarkers
Those weapons will become OP as shit.
Just sayin'
Related links

[Image: k5sVYyb.gif]
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
07-17-2012, 08:16
Post: #5
RE: Anti Hitmarkers
this does give me an idea for an instagib mod Big Grin

(XS4ALL/GoT2DayZ) DayZ Servers (http://got2dayz.nl)
[Image: b_350_20_2E3226_383F2D_D2E1B5_5A6C3E.png]
[Image: b_350_20_2E3226_383F2D_D2E1B5_5A6C3E.png]
[Image: b_350_20_2E3226_383F2D_D2E1B5_5A6C3E.png]
http://fb.me/GoT2DayZ
Visit this user's website Find all posts by this user
Add Thank You Quote this message in a reply
07-19-2012, 00:49 (This post was last modified: 07-20-2012 14:39 by jakata.)
Post: #6
RE: Anti Hitmarkers
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.

[Image: epvp71up3.png]
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Release] Anti-Invisible Name master131 24 4,914 05-02-2013 14:15
Last Post: .sepultura.
  [Release] Anti SpawnKills narkos 2 819 07-14-2012 18:42
Last Post: narkos
  [Release] Anti Flood plugin iAegle 10 2,289 03-22-2012 13:09
Last Post: dthem_2000

Forum Jump:


User(s) browsing this thread: 1 Guest(s)
Media Embeding by Simple Audio Video Embeder