This is a bad word filter on I worked just for the sake of keeping up my scripting skills (no current jobs).
HTML Code:
-Features
-- If player says a word in the list (not capital sensitive) it is replaced by *
-- Will stop all of the following & more (for example, the word cat):
--- cat
--- scat--- scats
--- s cat
--- s cat s
--- c at
--- ca t
-- Very easy to customize.
This is very easy to customize, all you need to do is add words to this.words; for example:
PHP Code:
this.words = { "word", "peace", "dude" };
can be changed to
PHP Code:
this.words = { "hi", "yo", "peace", "happy" };
or so.
You can find this.words in the onCreated function. Here is the code.
Code for Weapon/GUI-Script
-Filter:
PHP Code:
// Created by Chris Zakuto
//#CLIENTSIDE
function onCreated( NULL )
{
this.words =
{
"mac",
"for",
"lyfe"
};
}
function onPlayerChats( NULL )
{
if ( temp.chars != NULL )
{
temp.chars.clear();
}
temp.chat = player.chat;
if ( temp.rchat != NULL )
{
temp.rchat = "";
}
if ( temp.spac != NULL )
{
temp.spac = 0;
}
for ( temp.i = 0; temp.i < temp.chat.length(); temp.i ++ )
{
if ( temp.chat.substring( temp.i, 1 ) != " " )
{
temp.chars.add( { temp.i - temp.spac, temp.chat.substring( temp.i, 1 ), temp.spac } );
temp.rchat = temp.rchat @ temp.chat.substring( temp.i, 1 );
}
else
{
temp.spac ++;
}
}
for ( temp.a: temp.chars )
{
temp.n = ( temp.rchat.length() - temp.a[0] ) + 1;
for ( temp.x = 0; temp.x < temp.n; temp.x ++ )
{
for ( temp.y: this.words )
{
if ( temp.y == temp.rchat.substring( temp.a[0], temp.x ) )
{
temp.filter = temp.rchat.substring( temp.a[0], temp.x );
temp.filter2 = temp.filter.length();
if ( temp.zz != NULL )
{
temp.zz = "";
}
for ( temp.var = 0; temp.var < temp.filter2; temp.var ++ )
{
temp.zz = temp.zz @ "*";
}
player.chat = "[*]";
}
}
}
}
}