Blockland Forums > Modification Help
Chat filters
<< < (4/4)
computermix:

--- Quote from: Truce on October 13, 2010, 03:12:09 PM ---You need to use striPos, not strPos.

--- End quote ---

Is there a difference?
And, I found a solution.

--- Code: ---if(strupr(%text, "ass") >=0)

--- End code ---

It works! :3
It was really THAT easy?
"strupr" must be a str for upper-case.

Final, most graceful question. If you did enter "ass", instead of blocking it it would change the characters into "*"s or something like that. How/Could you do that?  Its not important, but I am wondering.
Bauklotz:

--- Code: ---addBadWord("ass");
package poop
{
     function serverCmdMessageSent(%cl,%msg)
     {
          %msg = filterString(%msg,"$#!@");
          Parent::serverCmdMessageSent(%cl,%msg);
     }
};
activatepackage(poop);

--- End code ---

Changes any occurence of ass to randomly picked characters: $#!@
Examples:
$$$
$!@
###
!!!
@$!
Destiny/Zack0Wack0:

--- Quote from: computermix on October 13, 2010, 03:20:26 PM ---
Is there a difference?

--- End quote ---
striPos is in-case sensitive
computermix:

--- Quote from: Destiny/Zack0Wack0 on October 14, 2010, 05:27:24 AM ---striPos is in-case sensitive

--- End quote ---
A little "i" always screws something up, eh?


--- Quote ---
--- Code: ---addBadWord("ass");
package poop
{
     function serverCmdMessageSent(%cl,%msg)
     {
          %msg = filterString(%msg,"$#!@");
          Parent::serverCmdMessageSent(%cl,%msg);
     }
};
activatepackage(poop);

--- End code ---

Changes any occurence of ass to randomly picked characters: $#!@
Examples:
$$$
$!@
###
!!!
@$!

--- End quote ---

This will come in handy. Thanks everyone, my problem is solved.
Navigation
Message Index
Previous page

Go to full version