Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[REQUEST] Anti-Vote Abuse
#1
I swear this one's not "retarded" so please dont call me such, or whatever other names you got.

I have some trouble on my servers. I like having "Votes" enabled so people can get rid of unwanted's when an admin is not around. People are abusing it too often.

I understand there is a Votekick plugin, but its to much for people to have to type it in and find/type their name etc. It just takes too long. But people can quickly use the built in one. So is it possible using the "Menu Votekick" and have the following in the plugin?

1: Making Admin immune to votekicks (From the "Menu")

2: Giving a warning on the second called vote and blocking votes for that user on the third. (Admin unaffected)

Thank you for taking time to read itsmodders. Peace out.......
Reply

#2
I like!
It possible?
[Image: b_560_95_1.png]
Reply

#3
Yes, it's possible to do.
[Image: azuw.jpg]
Reply

#4
(08-20-2012, 10:48)zxz0O0 Wrote: Yes, it's possible (for the genius itsmodders) to do. But not poor little NooB_StalkeR.

Fixed it for you kind sir. Good day, and thanks for the response.
Reply

#5
sounds a great idea, however i asked about the same sort of thing weeks ago and no-one made it.
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#6
Nah in 95% cases on itsmods you're gonna get what you want just in few minutes...
[Image: r212360a129ce9b84444093b6cd2699013a1fbn155.png]
Reply

#7
@g-man http://www.itsmods.com/forum/Thread-Serv...6#pid84086
Happend just yesterday.
Stop being so demotivational.
Reply

#8
Hello!

You can not kick an admin. (Except if you are one)
You can set the interval between 2 allowed votes.

If a player make 3 votes to kick an admin or an other type of vote between the interval he will be vote banned. Less than 3 time is warned only.

Sorry for the bad explaination, my english is not good...

Installation:
- Extract the zip file attached.
- Put the .dll in the plugin folder.
- Add the lines below in the "sv_config.ini"
Code:
[AntiVoteAbuse]
Vote_Interval=60
// Minimum time in seconds between 2 votes // No interval for admins ;)

I have not tested the plugin because i have no time right now to do it.
Give it a try and tell me if it's working correctly.

Csharp source code:
CSHARP Code
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using Addon;
  6.  
  7. namespace AntiVoteAbuse
  8. {
  9. public class AntiVoteAbuse : CPlugin
  10. {
  11. //* Attributs
  12. // Store the datetime of the latest vote of each players
  13. private DateTime[] Players_Last_Vote = new DateTime[18];
  14.  
  15. // Store the admins xuids
  16. private ArrayList Admins = new ArrayList();
  17.  
  18. // Store the players that can no more use vote
  19. private ArrayList Players_No_Vote = new ArrayList();
  20.  
  21. // Store the players vote spam ticks
  22. private int[] Players_Spam_Vote_Ticks = new int[18];
  23.  
  24. // Minimum time in seconds between 2 votes ( No interval for admins yeahhh )
  25. private int Vote_Interval = 60;
  26.  
  27. //* Functions
  28. // OnServerLoad
  29. public override void OnServerLoad()
  30. {
  31. try
  32. {
  33. // Get the admins xuids from permission plugin
  34. string[] get_admins = GetServerCFG("Permission", "Admin_xuids", "").Split(',');
  35. foreach (string admin in get_admins)
  36. {
  37. this.Admins.Add(admin);
  38. }
  39.  
  40. // Get the Interval between 2 votes
  41. this.Vote_Interval = Int32.Parse(GetServerCFG("AntiVoteAbuse", "Vote_Interval", "60"));
  42.  
  43. // Indicate that the plugin is loaded.
  44. ServerPrint("Plugin AntiVoteAbuse loaded! Author: Narkos");
  45. }
  46. catch(Exception e)
  47. {
  48. ServerPrint("Plugin AntiVoteAbuse: OnServerLoad catched exception: " + e.Message);
  49. }
  50. }
  51.  
  52. // OnPlayerConnect
  53. public override void OnPlayerConnect(ServerClient Client)
  54. {
  55. try
  56. {
  57. // Set the Players_Last_Vote of the player (Connecting to the server is like doing a vote, you have to wait an interval to be able to vote)
  58. this.Players_Last_Vote[Client.ClientNum] = DateTime.Now;
  59. }
  60. catch(Exception e)
  61. {
  62. ServerPrint("Plugin AntiVoteAbuse: OnPlayerConnect catched exception: " + e.Message);
  63. }
  64. }
  65.  
  66. // OnPlayerDisconnect
  67. public override void OnPlayerDisconnect(ServerClient Client)
  68. {
  69. try
  70. {
  71. // Set the player ticks to 0
  72. this.Players_Spam_Vote_Ticks[Client.ClientNum] = 0;
  73.  
  74. // If the player is vote banned, delete him or keep him banned???
  75. /*if (this.Players_No_Vote.Contains(Client.XUID))
  76.   {
  77.   this.Players_No_Vote.Remove(Client.XUID);
  78.   }*/
  79. }
  80. catch (Exception e)
  81. {
  82. ServerPrint("Plugin AntiVoteAbuse: OnPlayerDisconnect catched exception: " + e.Message);
  83. }
  84. }
  85.  
  86. // OnVote
  87. public override bool OnVote(String Vote, ServerClient Client, String OptionalArg)
  88. {
  89. try
  90. {
  91. // If the vote caller is not an admin
  92. if (!Admins.Contains(Client.XUID))
  93. {
  94. // If the player is not allowed to vote
  95. if (!this.Players_No_Vote.Contains(Client.XUID))
  96. {
  97. // The player is no more allowed to vote
  98. TellClient(Client.ClientNum, "You can not vote on this server!!!", true);
  99. return false;
  100. }
  101. else
  102. {
  103. if (DateTime.Now.Subtract(this.Players_Last_Vote[Client.ClientNum]).TotalSeconds < this.Vote_Interval)
  104. {
  105. // Interval not Ok, vote not allowed
  106. this.Players_Spam_Vote_Ticks[Client.ClientNum] += 1;
  107. if (this.Players_Spam_Vote_Ticks[Client.ClientNum] == 3)
  108. {
  109. // third spam vote in the same interval
  110. Players_No_Vote.Add(Client.XUID);
  111. TellClient(Client.ClientNum, "^1You have been vote banned! You can no more vote on this server!", true);
  112. }
  113. else
  114. {
  115. TellClient(Client.ClientNum, "^1No spam vote!!! " + (3 - this.Players_Spam_Vote_Ticks[Client.ClientNum]) + " more spam in the interval of " + this.Vote_Interval + " seconds = Vote Banned!", true);
  116. }
  117.  
  118. return false;
  119. }
  120. else
  121. {
  122. // Reset the player spam ticks
  123. this.Players_Spam_Vote_Ticks[Client.ClientNum] = 0;
  124.  
  125. // Set Players_Last_Vote[Client.ClientNum] to the current time
  126. this.Players_Last_Vote[Client.ClientNum] = DateTime.Now;
  127.  
  128. // If the vote is for kicking
  129. if (Vote == "kick")
  130. {
  131. // Get the clients list
  132. List<ServerClient> Clients = GetClients();
  133.  
  134. // If not null
  135. if (Clients != null)
  136. {
  137. // Loop the clients list
  138. foreach (ServerClient player in Clients)
  139. {
  140. // If the current player is the player to kick
  141. if (player.Name == OptionalArg)
  142. {
  143. // Check if the player to kick is an admin
  144. if (Admins.Contains(player.XUID))
  145. {
  146. // Ohoh try to kick an admin ahah!!
  147. this.Players_Spam_Vote_Ticks[Client.ClientNum] += 1;
  148. if (this.Players_Spam_Vote_Ticks[Client.ClientNum] == 3)
  149. {
  150. // third spam vote in the same interval
  151. Players_No_Vote.Add(Client.XUID);
  152. TellClient(Client.ClientNum, "^1You have been vote banned! You can no more vote on this server!", true);
  153. }
  154. else
  155. {
  156. TellClient(Client.ClientNum, "^1Don't try to kick an admin!!! " + (3 - this.Players_Spam_Vote_Ticks[Client.ClientNum]) + " more in the interval of " + this.Vote_Interval + " seconds = Vote Banned!", true);
  157. }
  158. return false;
  159. }
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. }
  167.  
  168. return true;
  169. }
  170. catch (Exception e)
  171. {
  172. ServerPrint("Plugin AntiVoteAbuse: OnVote catched exception: " + e.Message);
  173. // Error so let the vote happend
  174. return true;
  175. }
  176. }
  177. }
  178. }


Attached Files
.zip   AntiVoteAbuse.zip (Size: 3.05 KB / Downloads: 18)
Reply

#9
@narkos,

Very good job. It's awesome to see you contributing. Thank you. Smile
[Image: azuw.jpg]
Reply

#10
@zxz0O0 Thank you Wink

I love to code plugins for MW3!
The addon make the things so easy to do.... <3 <3 <3

When i coded this plugin, i saw that the "OptionalArg" in "OnVote" return the name of the player (If we vote to kick a player). Why not the xuid? I ask that because in this plugin if a player and an admin are on the server with the same name, i can not know the one that will be kicked...

A modification is possible?

Thanks a lot!
Reply



Possibly Related Threads…
Thread Author Replies Views Last Post
  [Release] iSnipe anti hardscope mutant 0 3,497 11-06-2013, 11:27
Last Post: mutant
  Need An Anti Hack Manuadminmod worldclass 2 3,734 10-14-2013, 09:57
Last Post: d0h!
  [Request] Request for Assistance with Modding COD: BO using Mod Tools one1lion 9 6,673 09-17-2013, 21:04
Last Post: one1lion
  [Request] Airdrop Heaven mod The_Reaper_1 0 2,451 09-10-2013, 14:13
Last Post: The_Reaper_1
  [Request] Request for !afk and !balance plugins. UlTiiMaTuM 3 3,572 09-10-2013, 02:13
Last Post: UlTiiMaTuM
  Searching for Anti HS ExoGamer* 10 6,690 08-08-2013, 12:39
Last Post: aceed
  [REQUEST] Antinoob mod sleepunknot 3 3,122 05-15-2013, 20:10
Last Post: sleepunknot
  [Release] Anti-Invisible Name master131 24 21,499 05-02-2013, 14:15
Last Post: .sepultura.
  Moab and server request CHRISLUVMSR 6 4,680 04-17-2013, 18:28
Last Post: X-Track
  [Request] Teknogods Expert's Classes 1.5 request The6thMessenger 0 2,428 04-13-2013, 08:22
Last Post: The6thMessenger

Forum Jump:


Users browsing this thread:
2 Guest(s)

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