Try this
Code:
public ChatGlobalCommand
(id
)
{
static lastsaid
[512], said
[512] , iPos;
read_args(said,
512)
if(equal(said, lastsaid
))
return PLUGIN_CONTINUE
for ( new i =
0 ; i < sizeof BAD_WORDS ; i++
)
{
//The return value of containi() cannot be used as a bool since it returns -1 (true) if nothing is found. Always use != -1, > -1, or >= 0
if ( ( iPos = containi( said , BAD_WORDS[i] ) ) > -1 )
{
//Replaced replace_all() with setc() to fill in bad word chars with *
setc( said
[ iPos
] ,
strlen( BAD_WORDS
[ i
] ) ,
'*' );
//replace_all( said , charsmax( said ) , BAD_WORDS[i] , "***")
}
}
formatex
(lastsaid, charsmax
(lastsaid
),
"%s", said
)
client_cmd(id,
"say %s", said
)
return PLUGIN_HANDLED
}
__________________