Swear Filter

Post Reply
robotics
A regular
A regular
Posts: 53
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Fri Oct 24, 2003 1:30 pm
Location: Seattle
Contact:

Swear Filter

Post by robotics »

Hey there,

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?
User avatar
Edge100x
Founder
Founder
Posts: 13120
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Post by Edge100x »

You need to put the compiled plugin in addons/amx/plugins. That means you need to upload the .amx file, and not the .sma file.
robotics
A regular
A regular
Posts: 53
Joined: Fri Oct 24, 2003 1:30 pm
Location: Seattle
Contact:

Post by robotics »

Yes, I have a file named swear.amx in addons/amx/plugins, not an sma file.
robotics
A regular
A regular
Posts: 53
Joined: Fri Oct 24, 2003 1:30 pm
Location: Seattle
Contact:

Post by robotics »

If anyone knows how to successfully install the profanity filter on my server (steps I've done are outlined in my original post), I would really appreciate it. If you need access to see what's going on, I would like to talk with you in IRC :)
Post Reply