Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release Anti SpawnKills
#1
Hi everyone,

Sorry for my bad English again, but I'm still a Swiss since my last topic Wink

I would like to release this small anti spawnkills plugin.
I made it because this week i played a lot on the face off maps, and sometimes the respawns were terribly bads....
You can set a deadline by which the players can not kill or be killed. (after spawn)
And you can chosse if it tells to players when they shot/are shoted by players during that free spawn time...

Add those lines to the sv_config.ini :
Code:
[AntiSpawnKills]
Enabled=1
// 0 or 1
SpawnFreeDelay=3
// Free time with no kills / deaths possible in seconds
SpawnFreeDelayShotInfo=1
// Indicate to the attacker and the victim when they shot/are shoted by players during the free spawn delay

Csharp source code :
CSHARP Code
  1. using System;
  2. using System.Collections;
  3. using System.Text;
  4.  
  5. using Addon;
  6.  
  7. namespace AntiSpawnKills
  8. {
  9. public class Class1 : CPlugin
  10. {
  11. // Create an array of datetimes
  12. private DateTime[] players_list = new DateTime[18];
  13. // Store the plugin status
  14. private string enabled = "0";
  15. // Store the free spawn delay
  16. private int free_spawn_delay = 0;
  17. // Store the free spawn delay shot info
  18. private int free_spawn_delay_shot_info = 0;
  19.  
  20. public override void OnServerLoad()
  21. {
  22. // Get the plugin status
  23. enabled = GetServerCFG("AntiSpawnKills", "Enabled", "0");
  24. // Get the free spawn delay
  25. free_spawn_delay = Int32.Parse(GetServerCFG("AntiSpawnKills", "SpawnFreeDelay", "2"));
  26. // Get the free spawn delay shot info
  27. free_spawn_delay_shot_info = Int32.Parse(GetServerCFG("AntiSpawnKills", "SpawnFreeDelayShotInfo", "1"));
  28. // Print plugin loaded
  29. ServerPrint("Plugin AntiSpawnKills loaded! (Enabled => " + enabled + ")");
  30. }
  31.  
  32. public override void OnPlayerSpawned(ServerClient Client)
  33. {
  34. // If plugin is enabled
  35. if (enabled == "1")
  36. {
  37. // Store the player spawn DateTime
  38. players_list[Client.ClientNum] = DateTime.Now;
  39. }
  40. }
  41.  
  42. public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, String Weapon, int Damage)
  43. {
  44. // If plugin is enabled
  45. if (enabled == "1")
  46. {
  47. // If the attacker is not the victim
  48. if (Attacker.XUID != Victim.XUID)
  49. {
  50. if (DateTime.Now.Subtract(players_list[Attacker.ClientNum]).TotalSeconds <= free_spawn_delay)
  51. {
  52. // If the Attacker is in free spawn delay
  53. // Set damage to 0
  54. Damage = 0;
  55. // If free spawn delay shot info is enabled
  56. if (free_spawn_delay_shot_info == 1)
  57. {
  58. TellClient(Attacker.ClientNum, "Impossible to kill during free spawn (" + Math.Round(free_spawn_delay - DateTime.Now.Subtract(players_list[Attacker.ClientNum]).TotalSeconds, 2) + " s. left)", true);
  59. TellClient(Victim.ClientNum, "You were shoted by a player in free spawn (" + Math.Round(free_spawn_delay - DateTime.Now.Subtract(players_list[Attacker.ClientNum]).TotalSeconds, 2) + " s. left)", true);
  60. }
  61. }
  62. else if (DateTime.Now.Subtract(players_list[Victim.ClientNum]).TotalSeconds <= free_spawn_delay)
  63. {
  64. // If the Victim is in free spawn delay
  65. // Set damage to 0
  66. Damage = 0;
  67. // If free spawn delay shot info is enabled
  68. if (free_spawn_delay_shot_info == 1)
  69. {
  70. TellClient(Attacker.ClientNum, "The player is in free spawn (" + Math.Round(free_spawn_delay - DateTime.Now.Subtract(players_list[Victim.ClientNum]).TotalSeconds, 2) + " s. left)", true);
  71. TellClient(Victim.ClientNum, "You were shoted during free spawn (" + Math.Round(free_spawn_delay - DateTime.Now.Subtract(players_list[Victim.ClientNum]).TotalSeconds, 2) + " s. left)", true);
  72. }
  73. }
  74. }
  75. }
  76. // Return the final damage
  77. return Damage;
  78. }
  79. }
  80. }


I'm open to every suggestions or comments.
Have Fun!


Attached Files
.zip   AntiSpawnKills.zip (Size: 2.46 KB / Downloads: 155)
Reply

#2
Nice release, is nice to see new plugins getting released everyday Cool
Reply

#3
Thanks!
I'll do my best to do good plugins Wink
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] iSnipe anti hardscope mutant 0 3,265 11-06-2013, 11:27
Last Post: mutant
  Need An Anti Hack Manuadminmod worldclass 2 3,507 10-14-2013, 09:57
Last Post: d0h!
  Searching for Anti HS ExoGamer* 10 6,159 08-08-2013, 12:39
Last Post: aceed
  [Release] Anti-Invisible Name master131 24 20,074 05-02-2013, 14:15
Last Post: .sepultura.
Wink Preview ANTI ZOOMBYE! [HARD] Tony. 9 5,693 03-02-2013, 17:35
Last Post: Nukem
  [Request] MW3 anti TI smasher MADD_DOGG 3 3,003 12-17-2012, 13:52
Last Post: MADD_DOGG
  Mw3 anti-cheat estebespt 18 14,959 12-04-2012, 22:50
Last Post: claudiocorona
  anti-hack ersin_ 8 5,804 10-29-2012, 14:45
Last Post: SuperNovaAO
  [Request] Anti block Plugin | Infected Kasperle 2 2,732 10-06-2012, 18:41
Last Post: DidUknowiPwn
  [Tutorial] Anti-Lag Guide iPaddie 5 4,840 09-28-2012, 18:56
Last Post: JariZ

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2024 Melroy van den Berg.