I am annoyed by people, which are always writing in languages, although my serverrules say, german or at least english. So i have written this plugin to get rid of these guys.
Features
This Plugins checks the words written in
chat. it counts written words and words found in the dictionary files and calculates a little bit. With the cvars you can define the rules, when a player should get a warning and/or when a player should be kicked, because he keeps talking in a
language, which is not one of the allowed ones on the server.
Because I like to understand my teammates.
since 1.1.2
Updater is supported.
Cvars:- sm_lc_languages - language files, separated by ";"
- sm_lc_enabled - enables plugin
- sm_lc_logging - enables debug logging
- sm_lc_min_wordcount - minimal written words before warning or kicks come
- sm_lc_max_wordcount - Maximal amount of words to calculate ratio
- sm_lc_min_warnings - minimal warnings before kick
- sm_lc_max_warnings - warnings to kick if sm_lc_kick is set to 2
- sm_lc_kick - 0: just warn, 1: kick by ratio, 2: kick by max_warnings
- sm_lc_kick_ratio - ratio of unrecognized words to kick (0.0-1.0)
- sm_lc_warn_ratio - ratio of unrecognized words to warn (0.0-1.0)
- sm_lc_use_index - Create an index
- sm_lc_version - Version (public)
Commands:- sm_init_dict - reinitialize dictionary files
- sm_lc_reset_player <name> - resets statistic for player
Dictionary Files:
Dictionary Files are located in
addons/sourcemod/gamedata
the files are named lc_<lang>.txt
so if you want the languages en_us and en_gb, you set you sm_lc_languages to "en_us;en_gb" and have the files lc_en_us.txt and lc_en_gb.txt
be careful, on linux the files are casesensitive
these Files have one word per line
You can find Dictionary Files
here. Just rename the .dic file to .txt.
Important: You cannot use this .txt now. The first entry will not be read, because the first six bytes of the file are crap. Two possibilities:
- Copy the content and save into a new .txt
- Open the file with a Hexeditor and delete the bullshitbytes
Indexed Dictionary Files:
For the proper work of the indexed files, the files must be sorted.
upper or lower does not matter.
index will only be used for ascii characters. if a word in
chat starts with a multibyte char, whole file will be searched.
Installation:
Extract zip file to addons/sourcemod/ or just normal install the plugin file and get your dictionary somewhere.
Changelog:
Quote:
v0.1 16.12.2012
Initial Release
|
Quote:
v1.0 17.12.2012- Fixing punctuation Bug
- Command to reset player statistics
- public Version cvar
- dictionary indexing
- code cleanup
- fixed dictionary files in zip
|
Quote:
v1.1.1 18.12.2012 - 5min later - fixed bug in version cvar
- fixed bug building index on dict-init although useIndex is false
- automated reindexing on changing sm_lc_languanges
|
Quote:
v1.1.2 22.12.2012- updater support
- Better calculation of badword-ratio
- Fixed Bug: empty-word counted
|
Quote:
v1.1.4 1.1.2013- Fixed Bug: Ratio set to best ratio on player connect
- Some more stuff in lolz
|
Quote:
v1.1.4.1 6.1.2013- Fixed Bug: Crash on plugin startup
|
Todo: