[REQUEST] Anti-Vote Abuse
#21
@hillbilly I'm at work now so i'll post the source tonight, but the only change i've done was taking off the "!" at line 95.
Replace this:
Code:
if (!this.Players_No_Vote.Contains(Client.XUID))

By this:
Code:
if (this.Players_No_Vote.Contains(Client.XUID))

@NooB_StalkeR Normal players can not votekick an admin, it cancel the vote, but an admin can votekick an admin.

When a player vote, i store his datetime, if the next vote is before the last datetime + the interval i warn the voter and cancel his vote. otherwise the vote is correct. (I also set the datetime when the player connect, so when he connects he have to wait the interval to be able to vote without warning, if you don't want that i can change it...)

I think it is not possible to know (at the moment) if the vote pass or if it is rejected, i need @zxz0O0 confirmation/help.

I'll do some more work on it to get a more configurable plugin, but i don't promise a release tonight, because of my wife Wink
Reply

#22
sorry to be a pain, but is it possible to add immune mods as well as Admins?
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#23
I dont know if your'e still interrested in this or not.

But if so could you please add:

-Manual VoteBan (ie !vban name) with partial names like regular ban
-Add vote immunity for player (ie !vi name)
-Look into whether called/passed/failed votes are in the logs somewhere, maybe the new logger plugin would help. And if a voting rep system is possible?

I am not aware of anyone being vote banned on my server and people call wrongfull votes over and over. Im getting close to blocking votes because "good" regulars keep getting harrassed by it. So manul voteban and immunity would help. Not complaing or anything I appreciate the work.


Also, do you believe it would be possible to use a votekick plugin that uses f1 and f2 rather than typing in !votekick name !y !n and could be called from the menu as normal. This could make voterep possible because your plugin would just override the default !votekick. Or a logger plugin that monitors votes?

Thanks
Reply

#24
iv'e had to remove it due to vote spamming even though it has an anti-vote spamming feature. Looks like another good idea that has been forgotten about.
[Image: b_560_95_1.png]


[Image: b_560_95_1.png]

Reply

#25
What happened with this plugin?
Is not it possible to create it?
It is very important for administrators
[Image: b_560_95_1.png]
Reply

#26
Hi,

I had some busy days, but i'm back Wink
I'll work on it now to add more stuff and configurable options...
Reply

#27
Hi Wink

New stuff, you can now:
- configure the displayed messages. (4 differents messages)
- choose if the moderators from permission plugin are immunized or not
- add immunized players (xuids)
- configure the number of warn before vote-ban a player
- use "!vi PlayerName" in-game to add a player to the immunized list (it will be saved in the sv_config.ini).

Add "!vi" to the allowed commands in permission plugin (for moderators).

Add those line to the "sv_config.ini":
Code:
Vote_Interval=60 // Minimum time in seconds between 2 votes // No interval for admins ;) Immunize_Moderators=1 // 1 = The moderators from permission plugin will be vote-kick immunized, 0 = not Immunized_Xuids= // A list of Immunized players xuids separated by comas Warns_Nbr=3 // Maximum number of warn before vote-ban a player Ban_Message=^1You have been vote banned! You can no more vote on this server! // The message that will be displayed to players when they get vote-banned Warn_Message=^1No spam vote!!! @WARN_LEFT@ more spam in the interval of @VOTE_INTERVAL@ seconds = Vote Banned! // The message that will be displayed to players when they get vote-warned, (don't forget to keep the @WARN_LEFT@ and the @VOTE_INTERVAL@ tokens if you want them to be displayed in the message...) Try_Admin_Kick_Message=^1Don't try to kick an admin!!! @WARN_LEFT@ more in the interval of @VOTE_INTERVAL@ seconds = Vote Banned! // The message that will be displayed to players when they try to kick an admin Try_Immunized_Kick_Message=^1Don't try to kick an immunized player (@PLAYER_NAME@)!!! @WARN_LEFT@ more in the interval of @VOTE_INTERVAL@ seconds = Vote Banned! // The message that will be displayed to players when they try to kick an immunized player

I haven't tested it, try it and let me know...

Csharp source code:
Code:
using System; using System.Collections; using System.Collections.Generic; using System.Text; using Addon; namespace AntiVoteAbuse { public class AntiVoteAbuse : CPlugin { //* Attributs // Store the datetime of the latest vote of each players private DateTime[] Players_Last_Vote = new DateTime[18]; // Store the admins xuids private ArrayList Admins = new ArrayList(); // Store the xuids of the immunized players private ArrayList Immunized_Xuids = new ArrayList(); // Store the players that can no more use vote private ArrayList Players_No_Vote = new ArrayList(); // Store the players vote spam ticks private int[] Players_Spam_Vote_Ticks = new int[18]; // Minimum time in seconds between 2 votes ( No interval for admins yeahhh ) private int Vote_Interval = 60; // Maximum number of warn before vote-ban a player private int Warns_Nbr = 3; // Vote-ban message private string Ban_Message = "^1You have been vote banned! You can no more vote on this server!"; // Vote-warn message private string Warn_Message = "^1No spam vote!!! @WARN_LEFT@ more spam in the interval of @VOTE_INTERVAL@ seconds = Vote Banned!"; // Vote-warn "try to kick an admin" message private string Try_Admin_Kick_Message = "^1Don't try to kick an admin!!! @WARN_LEFT@ more in the interval of @VOTE_INTERVAL@ seconds = Vote Banned!"; // Vote-warn "try to kick an immunized player" message private string Try_Immunized_Kick_Message = "^1Don't try to kick an immunized player (@PLAYER_NAME@)!!! @WARN_LEFT@ more in the interval of @VOTE_INTERVAL@ seconds = Vote Banned!"; //* Functions // OnServerLoad public override void OnServerLoad() { try { // Get the admins xuids from permission plugin string[] get_admins = GetServerCFG("Permission", "Admin_xuids", "").Split(','); // Loop the admins to add them to the list foreach (string admin in get_admins) { this.Admins.Add(admin); } // Get if the mods of permission plugin are immunized int Immunize_Moderators = Int32.Parse(GetServerCFG("AntiVoteAbuse", "Immunize_Moderators", "1")); if (Immunize_Moderators == 1) { // Get the moderators xuids from permission plugin string[] get_moderators = GetServerCFG("Permission", "Moderator_xuids", "").Split(','); // Loop the admins and add them to the list foreach (string moderator in get_moderators) { this.Immunized_Xuids.Add(moderator); } } // Get the immunized players xuids string[] get_immunized_xuids = GetServerCFG("AntiVoteAbuse", "Immunized_Xuids", "").Split(','); // loop the immunized players xuids and add them to the list foreach (string xuid in get_immunized_xuids) { this.Immunized_Xuids.Add(xuid); } // Get the Interval between 2 votes this.Vote_Interval = Int32.Parse(GetServerCFG("AntiVoteAbuse", "Vote_Interval", "60")); // Get the number of warn before vote-ban a player this.Warns_Nbr = Int32.Parse(GetServerCFG("AntiVoteAbuse", "Warns_Nbr", "3")); // Get the vote-ban message this.Ban_Message = GetServerCFG("AntiVoteAbuse", "Ban_Message", "^1You have been vote banned! You can no more vote on this server!"); // Get the vote-warn message this.Warn_Message = GetServerCFG("AntiVoteAbuse", "Warn_Message", "^1No spam vote!!! @WARN_LEFT@ more spam in the interval of @VOTE_INTERVAL@ seconds = Vote Banned!"); // Get the try to kick an admin message this.Try_Admin_Kick_Message = GetServerCFG("AntiVoteAbuse", "Try_Admin_Kick_Message", "^1Don't try to kick an admin!!! @WARN_LEFT@ more in the interval of @VOTE_INTERVAL@ seconds = Vote Banned!"); // Get the try to kick an immunized player message this.Try_Immunized_Kick_Message = GetServerCFG("AntiVoteAbuse", "Try_Immunized_Kick_Message", "^1Don't try to kick an immunized player (@PLAYER_NAME@)!!! @WARN_LEFT@ more in the interval of @VOTE_INTERVAL@ seconds = Vote Banned!"); // Indicate that the plugin is loaded. ServerPrint("Plugin AntiVoteAbuse loaded! Author: Narkos"); } catch(Exception e) { ServerPrint("Plugin AntiVoteAbuse: OnServerLoad catched exception: " + e.Message); } } // OnPlayerConnect public override void OnPlayerConnect(ServerClient Client) { try { // 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) this.Players_Last_Vote[Client.ClientNum] = DateTime.Now; } catch(Exception e) { ServerPrint("Plugin AntiVoteAbuse: OnPlayerConnect catched exception: " + e.Message); } } // OnPlayerDisconnect public override void OnPlayerDisconnect(ServerClient Client) { try { // Set the player ticks to 0 this.Players_Spam_Vote_Ticks[Client.ClientNum] = 0; // If the player is vote banned, delete him or keep him banned??? /*if (this.Players_No_Vote.Contains(Client.XUID)) { this.Players_No_Vote.Remove(Client.XUID); }*/ } catch (Exception e) { ServerPrint("Plugin AntiVoteAbuse: OnPlayerDisconnect catched exception: " + e.Message); } } // OnVote public override bool OnVote(String Vote, ServerClient Client, String OptionalArg) { try { // If the vote caller is not an admin if (!Admins.Contains(Client.XUID)) { // If the player is not allowed to vote if (this.Players_No_Vote.Contains(Client.XUID)) { // The player is no more allowed to vote TellClient(Client.ClientNum, "You can not vote on this server!!!", true); return false; } else { if (DateTime.Now.Subtract(this.Players_Last_Vote[Client.ClientNum]).TotalSeconds < this.Vote_Interval) { // Interval not Ok, vote not allowed this.Players_Spam_Vote_Ticks[Client.ClientNum] += 1; if (this.Players_Spam_Vote_Ticks[Client.ClientNum] == Warns_Nbr) { // reached the max warn number => vote-ban player Players_No_Vote.Add(Client.XUID); // Tell to the client that he has been vote-banned TellClient(Client.ClientNum, this.Ban_Message, true); } else { // Warn the player String Vote_Warn_Message2 = this.Warn_Message; Vote_Warn_Message2.Replace("@WARN_LEFT@", "" + (Warns_Nbr - this.Players_Spam_Vote_Ticks[Client.ClientNum])); Vote_Warn_Message2.Replace("@VOTE_INTERVAL@", "" + this.Vote_Interval); TellClient(Client.ClientNum, Vote_Warn_Message2, true); } return false; } else { // Reset the player spam ticks this.Players_Spam_Vote_Ticks[Client.ClientNum] = 0; // Set Players_Last_Vote[Client.ClientNum] to the current time this.Players_Last_Vote[Client.ClientNum] = DateTime.Now; // If the vote is for kicking if (Vote == "kick") { // Get the clients list List<ServerClient> Clients = GetClients(); // If not null if (Clients != null) { // Loop the clients list foreach (ServerClient player in Clients) { // If the current player is the player to kick if (player.Name == OptionalArg) { // Check if the player to kick is an admin if (this.Admins.Contains(player.XUID)) { // Ohoh try to kick an admin ahah!! this.Players_Spam_Vote_Ticks[Client.ClientNum] += 1; if (this.Players_Spam_Vote_Ticks[Client.ClientNum] == Warns_Nbr) { // reached the max warn number => vote-ban player Players_No_Vote.Add(Client.XUID); // Tell to the client that he has been vote-banned TellClient(Client.ClientNum, this.Ban_Message, true); } else { // Warn the player that trying to vote-kick an admin is stupid lol String Vote_Admin_Kick_Message = this.Try_Admin_Kick_Message; Vote_Admin_Kick_Message.Replace("@WARN_LEFT@", "" + (Warns_Nbr - this.Players_Spam_Vote_Ticks[Client.ClientNum])); Vote_Admin_Kick_Message.Replace("@VOTE_INTERVAL@", "" + this.Vote_Interval); TellClient(Client.ClientNum, Vote_Admin_Kick_Message, true); } return false; } if (this.Immunized_Xuids.Contains(player.XUID)) { // Ohoh try to kick an immunized player ahah!! this.Players_Spam_Vote_Ticks[Client.ClientNum] += 1; if (this.Players_Spam_Vote_Ticks[Client.ClientNum] == Warns_Nbr) { // reached the max warn number => vote-ban player Players_No_Vote.Add(Client.XUID); // Tell to the client that he has been vote-banned TellClient(Client.ClientNum, this.Ban_Message, true); } else { // Warn the player that trying to vote-kick an immunized player is not allowed String Try_Immunized_Kick_Message2 = this.Try_Immunized_Kick_Message; Try_Immunized_Kick_Message2.Replace("@WARN_LEFT@", "" + (Warns_Nbr - this.Players_Spam_Vote_Ticks[Client.ClientNum])); Try_Immunized_Kick_Message2.Replace("@VOTE_INTERVAL@", "" + this.Vote_Interval); Try_Immunized_Kick_Message2.Replace("@PLAYER_NAME@", player.Name); TellClient(Client.ClientNum, Try_Immunized_Kick_Message2, true); } return false; } } } } } } } } return true; } catch (Exception e) { ServerPrint("Plugin AntiVoteAbuse: OnVote catched exception: " + e.Message); // Error so let the vote happend return true; } } public override ChatType OnSay(string Message, ServerClient Client, bool Teamchat) { // If the message starts with !vi if (Message.StartsWith("!vi")) { // Split the message by spaces string[] message_words = Message.Split(' '); // If there is more than 1 word if (message_words.Length > 1) { // Get the clients list List<ServerClient> Clients = GetClients(); string player_to_found = Message.Substring(4); // If not null if (Clients != null) { // Loop the clients list foreach (ServerClient player in Clients) { if (player.Name == player_to_found) { if (this.Immunized_Xuids.Contains(player.XUID)) { TellClient(Client.ClientNum, "This player is already immunized!", true); } else { // Add the player to the immunized list this.Immunized_Xuids.Add(player.XUID); // Save the player in the servercfg SetServerCFG("AntiVoteAbuse", "Immunized_Xuids", GetServerCFG("AntiVoteAbuse", "Immunized_Xuids", "") + "," + player.XUID); return ChatType.ChatNone; } } } } TellClient(Client.ClientNum, "Impossible to found the player to immunize!", true); } } return ChatType.ChatContinue; } } }


Attached Files
.zip   AntiVoteAbuse.zip (Size: 3.82 KB / Downloads: 43)
Reply

#28
This feature is important.
Vote_Kick_Only=0
// 0 = only votekick affected, 1 = all the vote types
You can disable "next map" and "map vote"?

thanks
[Image: b_560_95_1.png]
Reply

#29
Hello,

You have this setting "Vote_Kick_Only=0" because i forget to take it out when i posted the last message.
I edited the post just after you took it... ;(
When i posted the message this part was not done in the code ( lol ).

I added it yesterday but i haven't released yet, i'll release it tonight or as soon as possible.

You want the "next map" and "map vote" disabled in the menu? Sorry i can't do this.
I only can block this vote when called.

(The "Vote_Kick_Only=0" is to know for what type of vote you want the antivoteabuse to warn/vote-ban players.
0 = all type of vote are controled by the plugin, 1 = only the vote-kick is controled)
Reply

#30
(09-11-2012, 10:31)narkos Wrote: I added it yesterday but i haven't released yet, i'll release it tonight or as soon as possible.

You want the "next map" and "map vote" disabled in the menu? Sorry i can't do this.
I only can block this vote when called.

Perfect!!Big Grin
[Image: b_560_95_1.png]
Reply



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

Forum Jump:


Users browsing this thread:
1 Guest(s)

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