Last active
August 29, 2015 13:59
-
-
Save tmiland/10687814 to your computer and use it in GitHub Desktop.
Mute on Hackusations - From https://forum.myrcon.com/showthread.php?7764-Insane-Limits-Mute-on-Hackusations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set limit to evaluate OnAnyChat, set action to None | |
Set first_check to this Code: */ | |
List<String> hackusations = new List<String>(); | |
// Matching hack, hacker, haxor, hacking, hacks, wallhack | |
hackusations.Add(@"\b(wall)?ha(ck|xo)(er|ing|ed|s|r)?\b"); | |
// Matching cheat, cheater, cheating, cheats | |
hackusations.Add(@"\bche(at)(er|ing|ed|s)(s)?\b"); | |
// Matching exploit, exploiter, exploiting, exploits | |
hackusations.Add(@"\bexploit(er|ing|ed|s)?\b"); | |
// Matching glitch, glitcher, glitching | |
hackusations.Add(@"\bglitch(er|ing|ed)?\b"); | |
String[] chat_words = Regex.Split(player.LastChat, @"\s+"); | |
foreach(String chat_word in chat_words) | |
{ foreach(String hackusation in hackusations) | |
{ if (Regex.Match(chat_word, "^"+hackusation+"$", RegexOptions.IgnoreCase).Success) | |
{ | |
return true; | |
} | |
} | |
} | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Set second_check to this Code: */ | |
string fancy_time = DateTime.Now.ToString("HH:mm:ss"); | |
string fancy_date = DateTime.Now.ToString("dd-MM-yyyy"); | |
double count = limit.Activations(player.Name); | |
String msg = "none"; | |
Action<String> ChatPlayer = delegate(String who) { | |
plugin.ServerCommand("admin.yell", msg, "15", "player", who); | |
plugin.ServerCommand("admin.say", msg, "player", who); | |
}; | |
if (count == 1) { | |
msg = plugin.R("ATTENTION %k_n%! If you suspect a hacker, report him with !report playername reason "); | |
ChatPlayer(player.Name); | |
plugin.PRoConChat("ADMIN MUTE > " + msg); | |
} | |
if (count == 2) { | |
msg = plugin.R("ATTENTION %k_n%! Please avoid Hackusations, you will be muted for the rest of the round!"); | |
plugin.SendPlayerYell(player.Name, msg, 20); | |
plugin.SendGlobalMessage(msg); | |
plugin.PRoConChat("ADMIN MUTE > " + msg); | |
plugin.ConsoleWrite("^b^1ADMIN MUTE >^0^n " + player.FullName + " tripped the Hackusations filter! "); | |
plugin.Log("Logs/InsaneLimits_hackusations.log", plugin.R("[" + fancy_date + "][" + fancy_time + "] %p_n% said: [" + player.LastChat + "]")); | |
} | |
else if (count == 3) { | |
msg = plugin.R("/@mute " + player.Name + " You have been muted for Hackusations in chat!"); | |
plugin.ServerCommand("admin.say", msg); | |
plugin.SendPlayerYell(player.Name, msg, 20); | |
plugin.SendGlobalMessage(msg); | |
plugin.PRoConChat("ADMIN MUTE > " + msg); | |
plugin.ConsoleWrite("^b^1ADMIN MUTE >^0^n " + player.FullName + " has been muted for Hackusations! "); | |
plugin.Log("Logs/InsaneLimits_hackusations.log", plugin.R("[" + fancy_date + "][" + fancy_time + "] %p_n% said: [" + player.LastChat + "]")); | |
} | |
return false; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment