Author Topic: Auto kicking clients When they swear.  (Read 2178 times)

Is there a way to have somone automatically kicked if they said a swear or something like "Is this a long load?" using a script? If so can i have an example please?
« Last Edit: October 28, 2008, 04:00:40 PM by Lord logan/sammo »

doesn't this topic's name break the forum rules?

Change it to "auto kicking clients when they swear". Or something.

Kicked, I believe so. It wouldn't be that great for a beginner to try, though, and you don't seem like you know what you're doing.

Banned, probably, but I have no clue how it works

Yes it is possible.
However, change the topic title.


There are too many ways to ask if the load is long, it wouldn't be worth it.
As for kicking for swearing, how about you just turn on chat censoring?

There are too many ways to ask if the load is long, it wouldn't be worth it.
As for kicking for swearing, how about you just turn on chat censoring?

How about just showing me how to do it one way then. I know there is more than one way to ask how long the load is. But i just want an example.

Code: [Select]
package AutoKick
{
    function serverCmdMessageSent(%client,%message)
    {
        Parent::serverCmdMessageSent(%client,%message);
        if(strstr(%message,"pineapple") > -1)
        {
            %client.delete("Pineapple is an autokick word");
            messageAll('','%1 kicked for saying an autokick word',%client.name);
        }
    }
};
ActivatePackage(AutoKick);

 :cookieMonster:
« Last Edit: October 28, 2008, 06:40:22 PM by Headcrab Zombie »

Personally when someone asks how long a load is, I just say "very long" (even on short loads) just to make them leave.

Nice Headcrab thanks for the example.

        if(strstr(%message,"pineapple") > -1);

Looks great, just make sure you get rid of the bold'd semicolan before you try it.

Edit: Tested, and it works after you remove it :)

For anyone who just wants to copy and paste, heres the complete, fully working code:

Code: [Select]
package AutoKick
{
    function serverCmdMessageSent(%client,%message)
    {
        Parent::serverCmdMessageSent(%client,%message);
        if(strstr(%message,"pineapple") > -1)
        {
            %client.delete("Pineapple is an autokick word");
            messageAll('','%1 kicked for saying an autokick word',%client.name);
        }
    }
};
ActivatePackage(AutoKick);

And one last thing, if you want more then just one auto kick word, you can add the following to your if statement:
Code: [Select]
|| strstr(%message,"word2") > -1)Btw, || means or in if statements.

So for 2 words, example:
Code: [Select]
if(strstr(%message,"pineapple") > -1 || strstr(%message,"word2") > -1)
And you can keep adding on. I hope I helped build on what Headcrab did.
« Last Edit: October 28, 2008, 05:25:37 PM by Dr Bling »

Looks great, just make sure you get rid of the bold'd semicolan before you try it.
Hmm, I guess I forgot to fix the code in the post after I fixed the code I tested.  :cookieMonster:

Personally when someone asks how long a load is, I just say "very long" (even on short loads) just to make them leave.
What he said.

Code: [Select]
package swearAutoKick
{
function servercmdmessagesent(%client,%message)
{
if(
strstr(%message,"forget") ||
strstr(%message,"stuff") ||
strstr(%message,"ass") ||
strstr(%message,"cunt") ||
strstr(%message,"monday") ||)
{
%client.delete("Are host is a loving pusillanimous individual and doesn\'t like swearing, sorry.");
messageall('','\c3%1\c0Has been kicked for swearing (Yeah i know, the host is a pusillanimous individual)',%client.name);
echo("This server sucks.");
return;
}
parent::servercmdmessagesent(%client,%message);
}
};
activatepackage(swearAutoKick);

The fact that you want to remove swearing seems pointless and will end in failure.

You know allot of Innocent bl'ers will get kicked for saying something like this:

"This server is badass!"

Even though it was a complement, you still kick him.

I find the best way is to deal with it. swearing will always exist, mite as well get used to it.
« Last Edit: October 28, 2008, 08:02:23 PM by Skylord123 »