Forums Index >> Modding >> KICK SCRIPT: kick players by name from console



Page : <1> :


HI all,

I made a script to kick players by name. Go here

kick script

There are instructions on its use inside the download files. However since people seem to ask here a lot...

These functions will only work from the server console, which means it has to be a dedicated server.

At the console prompt which is a % symbol type the following

Idiot("dash");

That will kick the player dash from your server

If a user has a strange name and you can't type the characters into the console use the users function

Users();

This will list all users and some info about each

NAME, IP ADDRESS, PING, CADD

CADD is the users client id you can kick users with this number

CADD.delete("");

If you type literally CADD.delete(""); then kick yourself in the head and try again. I mean a number when I say CADD

 

Last edited: Tuesday, June 22, 2004 at 7:55:23 PM

Friday, June 18, 2004 at 1:50:14 PM

Cool I'll test it right away!

You don't have to let go of one rope before grabbing the other. But you'll have to let go of one if you want to swing forward.

Friday, June 18, 2004 at 1:55:50 PM

That's awesome! It's easy to use! It's way better than the old system! Did I say its AWESOME!

Nice work dash : )

PS: I like it a lot!

You don't have to let go of one rope before grabbing the other. But you'll have to let go of one if you want to swing forward.

Friday, June 18, 2004 at 2:04:40 PM

AWESOME! Can't wait to try it out!

Friday, June 18, 2004 at 2:24:45 PM

Does it work for partial names, or is it the full name only?

Friday, June 18, 2004 at 2:36:29 PM

@Michael It currenlty works for full names only. I would need some documentation on regular expression syntax for torquescript. I am having a tough time finding documentation for torquescript at all. Another function included at the link above is users()

% users();

Will output a list of all players in the format : name, IP,PING,CADD

So if someone has a wacky name you can quickly get their CADD and do the CADD.delete("loser"); trick

I welcome feedback and code. I would like to sort out how to make it available as a code from within the game available to players with admin privilege. I would also like to know how to keep a list of ips and write an ip based ban version

Friday, June 18, 2004 at 3:17:44 PM

Made a few changes, hope you don't mind.

Ex)

$client.delete("You have been kicked out. If you try to return and continue to be an idiot, we will sick a group of monkies on your ass");

 

Friday, June 18, 2004 at 8:59:42 PM

Lol, I really don't wanna be an idiot in your server Ice Punk! Lolololololololololololololol %) seems great so that you can kick all the annoying players off, like all the aliases of anon. :)

Saturday, June 19, 2004 at 8:33:03 AM

$client.delete("You have been kicked out because your brain seems to be smaller than your gun. We realize that you often find yourself inadequate in most aspects of your life. Being an idiot is not going to change your unfortunate situation. If you return we will hunt you down and shoot you. If you survive you will be shot again. Have a nice day:)");

B

Saturday, June 19, 2004 at 11:11:59 AM

$client.delete("I like cats, do you?"); *awkward silence...*

Saturday, June 19, 2004 at 11:43:56 AM

$client.delete("My hat is pink");

Beware the pink hat....

Saturday, June 19, 2004 at 8:34:31 PM

How do I kick players? I installed it.

Saturday, June 19, 2004 at 10:41:20 PM

$client.delete("How do I kick u out? Can u plz tell me?");

Saturday, June 19, 2004 at 11:38:18 PM

In the command console type

Idiot("NameOfPersonToKickGoesHere");

Nice script Dash, it sure would be nice not to allow the player to return until after the currant game is completed.

4/1/1929 to 11/17/2006 Rest in Peace Bo. GO BLUE!!!

Last edited: Sunday, June 20, 2004 at 1:04:58 PM

Sunday, June 20, 2004 at 12:31:36 AM

But if this script got into the wrong hands.... The PTT police witch theres only 2! Me and UFO we can not stop em if they boot everybody then what Hmmmmmmmm you need a counter script for some people so if you get one and you say counter it wold be like... "UP YOURS GO AWAY!" but then what if they got that to then it would be counter warz! Um on second thought I will just take it and be outta hear......

Thank you may the PTT's honor be with you!

Sunday, June 20, 2004 at 11:54:55 PM

Excellent, this is really nice. Good job.

Thank you.

Jinx

Monday, June 21, 2004 at 4:32:09 AM

So wat do I type to get some out of that server

 

Monday, June 21, 2004 at 9:31:44 PM

I give up.

:[

4/1/1929 to 11/17/2006 Rest in Peace Bo. GO BLUE!!!

Last edited: Monday, June 21, 2004 at 11:14:23 PM

Monday, June 21, 2004 at 11:13:19 PM

LMFAO!

Monday, June 21, 2004 at 11:19:12 PM

What??? I am going to change mine so I can kick anywhere! Hey a am a PTT POLICE how are we supposed to do our job if we don't have a script to it with? XD

Tuesday, June 22, 2004 at 9:43:27 AM

Do u got 2 be a adminstrator of the server 2 kick players?

 

Tuesday, June 22, 2004 at 7:43:22 PM

? Um whompa please make SOME sense

Tuesday, June 22, 2004 at 7:48:42 PM

Hmmm, anyone know how to get a persons CADD? I noticed on the script it is just the persons ping and I would like to change it. :)

Tuesday, June 22, 2004 at 8:54:56 PM

Oops you have the buggy version michael. Check the site I changed it shortly after posting

The script

Tuesday, June 22, 2004 at 9:40:17 PM

Thanks. :)

Wednesday, June 23, 2004 at 1:34:22 PM

Its to hard 4 me to understand :(

Thursday, June 24, 2004 at 12:13:12 AM
-v-

So to kick someone out I have to put this down ldiot("someone"); thats it?

Thursday, June 24, 2004 at 10:11:49 PM

 

 

What??? I am going to change mine so I can kick anywhere! Hey a am a PTT POLICE how are we supposed to do our job if we don't have a script to it with?

 

Your actually taking this "PTT police" thing seriously? I doubt if you have the nessesary skills to do that!

Plus,ThinkTanks has to have something that will stop you from doing that.

@Wompa: Yes,you do have to be the server administrator.

Thursday, June 24, 2004 at 10:23:24 PM

That's It ;)

4/1/1929 to 11/17/2006 Rest in Peace Bo. GO BLUE!!!

Last edited: Thursday, June 24, 2004 at 11:21:37 PM

Thursday, June 24, 2004 at 11:20:55 PM

 

 

If you type literally CADD.delete(""); then kick yourself in the head and try again. I mean a number when I say CADD

 

LOL!

Friday, June 25, 2004 at 1:22:03 PM

Umm does it only work in dedacated?

Friday, June 25, 2004 at 7:28:37 PM

So I type is all this junk in main.cs?

// console command: users();

// list all users in server.

// display format: NAME, IP ADDRESS, PING, CADD

Function users()

{

$len = clientgroup.getCount();

For($I=0;$I<$len;$I++)

{

$u = clientgroup.getObject($I);

$id = $u.getId();

$user = $u.nameBase;

$addr = $u.getAddress();

$ping = $u.getPing();

Echo($user@", "@$addr@", PING: "@$ping@", CADD: "@$id);

}

}

// console command name2cadd();

// maps a name to a cadd

Function name2cadd(%name)

{

$target = %name;

$len = clientgroup.getCount();

For($I=0; $I<$len; $I++)

{

$u = clientgroup.getObject($I);

If ($target $= $u.nameBase)

Return $u;

}

Return 0;

}

// console command: idiot("NameOfPersonToKickGoesHere");

// for kicking undesireable elements

Function idiot(%name)

{

$target = %name;

$client=name2cadd($target);

If ($client!=0)

{

Centerprintall($nm@" HAS BEEN KICKED FOR BAD BEHAVIOR ",4);

$client.delete("YOU ARE WELCOME BACK WHEN YOU LEARN TO PLAY WELL WITH OTHERS");

}

Else

{

Echo("Failed mapping name to a CADD");

}

}

 

Friday, June 25, 2004 at 7:37:17 PM

And I tryed iyt it doesent work I dont get it....................

Friday, June 25, 2004 at 7:37:53 PM

No Kat that is the script it goes in the bottom of your main.cs file or just save a copy of your main.cs file

And replace it with the one at the download site.

Then at the console of a dedicated server type

Idiot("dash");

To kick dash

These commands do not work from inside the game or with anything but a dedicated server.

Monday, June 28, 2004 at 2:55:07 PM

@ -v-:

Im not an idiot. I just have a hard time understanding computer programing. So just shut up

Monday, June 28, 2004 at 2:57:25 PM

Page : <1> :

insert quote insert url insert email insert image bold italic underline superscript subscript horizontal rule : : Help on using forum codes

Add comment:

HTML is disabled within comments, but ZBB Code is enabled.

Back to the top

Web site designed, maintained and funded by -z- and Dan MacDonald