Is there a possibility to mute players, if they not use latin letters?
I had once enabled 'Anti bad language' in RustAdmin, to kick all players who type Cyrillic letters, but thats not working with Better Chat, or in general.
Or
Auto mute players on join, if they from a specific country.
Thanks!
Solved Auto mute people
Discussion in 'Plugin Requests' started by Frank Costello, Jul 24, 2016.
-
Anyone? I can pay for it.
-
Wulf Community Admin
There should be some plugins that already provided chat filtering such as BetterChat, Chat Handler, etc.
-
Yeah, i know the BetterChat feature 'Word Filter', but isn't it only for single words? I need something that blocks Cyrillic letters/words in general.
Thanks
-
well something like that in betterchat should work
Just add this code part to betterchat plugin inCode:if(Regex.IsMatch(stringToCheck,@"\p{IsCyrillic}")) { SendChatMessage(player, "You can't used that language, please use international language."); return false; }
object OnUserChat(IPlayer player, string message)
like that
Feel free to donate if i helpedCode:object OnUserChat(IPlayer player, string message) { Player pl = Player.FindOrCreate(player); if (pl == null) PrintWarning("PLAYER IS NULL!"); if (GetConfig(false, "Word Filter", "Enabled")) message = FilterText(message); // Is message invalid? if (message == string.Empty || message.Length < General_MinimalChars) return false; pl.mute.Update(); // Is global mute active? if (globalMute) { SendChatMessage(player, GetMsg("Global Mute", player.Id)); return false; } // Is player muted? if (pl.mute.Muted) { if (pl.mute.state == MutedState.TimeMuted) { TimeSpan remainingTime = pl.mute.date.value - DateTime.Now; SendChatMessage(player, GetMsg("You Are Time Muted", player.Id).Replace("{time}", FormatTime(remainingTime))); } else SendChatMessage(player, GetMsg("You Are Muted", player.Id)); return false; } if(Regex.IsMatch(stringToCheck,@"\p{IsCyrillic}")) { SendChatMessage(player, "You can't used that language, please use international language."); return false; }
Last edited by a moderator: Jul 25, 2016 -
Gonna try it out soon, gonna donate for sure if its working. Thanks in advance!

EDIT: Just tested it. The name `stringToCheck' does not exist in the current contextLast edited by a moderator: Jul 26, 2016 -
Wulf Community Admin
"stringToCheck" was just a placeholder, you'd need to replace it with the message variable in the example that was given. -
Oh yeah sorry I miss to change it back to message
-
Damn, never thought it would be so easy, i remember putting \p{Cyrillic} in RustAdmin and it worked for normal chat. Anyways.. thanks for helping me sami37 and Wulf!
You can mark this as solved -
You set it as solved using the thread tools.
