I was wanting to know how to install a swear filter on the server I rent from you folks. Basically, a rep from NFO referred me to:
http://amxmod.net/amx-plugins.php?cat=3
Number 4 on that list is the one I'm after. I want to install this swear filter but NOT punish people who swear (i.e. slap, or ban or kicking, none of that).
I've had problems with installing this.
Here's what I did.
I put the following code in addons/amx/plugins/
/* AMX Mod Script.
*
* (c) Copyright 2002-2003, RAV
* This file is provided as is (no warranties).
*
* Swearing will be filtered.
*
* Changelog:
* 1.20 - Fixed some bugs
* 1.10 - Initial Release
*/
#include <amxmod>
// max number of words in word list
#define MAX_WORDS 64
// Number of random messages.
#define MESSAGES 4
new g_messages[MESSAGES][] = {
"hello!",
"sup",
}
// file to read words from
new g_wordList[] = "addons/amx/wordlist.ini"
new g_swears[MAX_WORDS][32]
new g_swearsNum
public plugin_init()
{
register_plugin("SWEAR FILTER","0.9","Rav")
register_clcmd("say","swearFilter")
register_clcmd("say_team","swearFilter")
if (file_exists(g_wordList))
{
new len, i = 0
while( read_file(g_wordList,i++,g_swears[g_swearsNum],31,len) )
if (len) ++g_swearsNum
}
else log_message("[AMX] Swear file not found (name ^"%s^")",g_wordList)
}
public swearFilter(id)
{
new said[128]
read_args(said,127)
for (new i=0; i<g_swearsNum; ++i)
{
if ( containi(said,g_swears) != -1 )
{
engclient_cmd(id,"say",g_messages[ random_num(0,MESSAGES-1) ])
return PLUGIN_HANDLED
}
}
return PLUGIN_CONTINUE
}
Then I made a file called wordlist.ini in addons/amx
My wordlist.ini file looks like this:
[msg]yoyo
[msg]sup
[msg]hey
[msg]hey
[msg]hey
[msg]hey
[msg]hey
f u
omfg
stfu
wtf
bitch
fuck
shit
***
***
***
And then finally I put this in my plugins.ini folder under amx
; swear filter
swear.amx
But it didn't work, any ideas?