That's not better, because there are badwords like:
Hure (whore)
Hurensohn (son of a whore)
Hurenkind (child of a whore)
etc. hundrets more
Or the people start to insult with "!" behind the badwords or something.
Now i made it like that:
PHP Code:
new len = strlen(message)
new asc = 0, num = 0
for (new i = 0;i <= len;i++)
{
if (message[i] == 32)
{
asc++
num = 0
}
else
{
token[asc][num] = message[i]
num++
}
}
new b_found, b_ignore
for (new i = 0;i <= len;i++)
{
if(token[i][0])
{
new b_word = 0
while ( b_word < g_swearNum_high )
{
if ( containi ( token[i], badword_high[b_word++] ) != -1 )
{
b_found++
}
}
b_word = 0
while ( b_word < g_swearNum_mid )
{
if ( containi ( token[i], badword_mid[b_word++] ) != -1 )
{
b_found++
}
}
b_word = 0
while ( b_word < g_swearNum_warn )
{
if ( containi ( token[i], badword_warn[b_word++] ) != -1 )
{
b_found++
}
}
b_word = 0
while ( b_word < g_swearNum_ignore )
{
if ( containi ( token[i], badword_ignore[b_word++] ) != -1 )
{
b_ignore++
}
}
copy(token[i], 511, "0")
}
}
if(b_found <= b_ignore)
{
badword_found = true
}
It's a weird way, but it works better than everything else.