ChatFilter.as
is a simple plugin that will allow you to avoid unnecessary problems when communicating with toxic players.
The task of this plugin is to censor incoming messages if they contain obscene words.
Installing the plugin consists of several steps:
- Download this plugin;
- Open the
..\Sven Co-op\svencoop_addon\scripts\plugins
directory and place theChatFilter
folder there; - Next, go to the
..\Sven Co-op\svencoop
folder and find there the text filedefault_plugins.txt
; - Open this file and paste the following text into it:
"plugin"
{
"name" "ChatFilter"
"script" "ChatFilter/ChatFilter"
}
- Next, navigate to the
..\Sven Co-op\svencoop_addon\scripts\plugins\ChatFilter
directory; - Open the
BadWords.txt
file and write the words you want to censor in it. For example, it could be the following words:
fuck
bitch
gay
shit
nigg
whore
slut
faggot
bastard
asshole
dafaq
nerd
пидор
даун
конч
уебок
придурок
долбаеб
ебаный
нахуй
хуй
сука
блять
You can add words in any language (I only tested two languages).
REMEMBER: The LoadBadWordsFromFile
function reads the file line by line, so we need a one-line indent between each new word in the BadWords.txt
file.
REMEMBER: The Filter
function is no longer case-sensitive when replacing words. The words shiT
, sHIt
or Shit
will be recognized by the filter as one swear word, unless the player writes the word sh1t
or something else. Therefore, in the file BadWords.txt
you will need to write only one variation of this word. But even this can be easily bypassed by putting a single space character between the word, such as s h i t
.
REMEMBER: Added encoding definition. The Filter
function will now replace a two-byte encoded character with a single asterisk *
character.
REMEMBER: This plugin may conflict with the ChatColors plugin.
- Now, after placing the plugin in the game files and after filling in the text file
BadWords.txt
, you can run the game and check the result.