Jump to content
Sign in to follow this  
gossamersolid

serverCommand usage?

Recommended Posts

serverCommand "#kick _name"

Would that effectively kick the player that is stored in the variable _name?

There's not documentation/examples on the wiki so I'm not sure on the usage.

Share this post


Link to post
Share on other sites

serverCommand format["#kick %1",_name];

And yes I've used it. I've developed an RCON tool with it.

Share this post


Link to post
Share on other sites
serverCommand format["#kick %1",_name];

And yes I've used it. I've developed an RCON tool with it.

as in the rcon tool is an executable that we can actually RCON into our servers with?

If so then you should release that, I'm sure everybody would use it !

Share this post


Link to post
Share on other sites

Yep. Going to start testing it out on a couple of servers soon, and if that goes well then I'll try and release it.

Share this post


Link to post
Share on other sites

well I couldn't get it to work still even with that syntax you showed me. Didn't give me an error, but didn't do anything.

People will know why they were kicked, it displays a message then counts 5 seconds then kicks them.

Share this post


Link to post
Share on other sites
well I couldn't get it to work still even with that syntax you showed me. Didn't give me an error, but didn't do anything.

People will know why they were kicked, it displays a message then counts 5 seconds then kicks them.

Works fine here. Are you logging in first?

i.e.

serverCommand "#login password";
serverCommand format["#kick %1",_name];
serverCommand "#logout";

where password is, of course, the admin password for the server.

You can also check to make sure you can execute the command first--so you can essentially check to see if you're logged in--like so:

if(serverCommandAvailable "#kick") then {
    serverCommand format["#kick %1",_name];
} else {
   diag_log "Unable to kick player: Not logged in!";
};

Edited by MH6

Share this post


Link to post
Share on other sites
Works fine here. Are you logging in first?

i.e.

serverCommand "#login password";
serverCommand format["#kick %1",_name];
serverCommand "#logout";

where password is, of course, the admin password for the server.

You can also check to make sure you can execute the command first--so you can essentially check to see if you're logged in--like so:

if(serverCommandAvailable "#kick") then {
    serverCommand format["#kick %1",_name];
} else {
   diag_log "Unable to kick player: Not logged in!";
};

is there a secure way to login? I'd rather not write my server password in there for some punk to go download the mission from the server and unPbo it... also kinda ruins it for usage on other servers.

Now why would they make a script have to "login"... it kind of defeats the purpose of the server being able to use the commands.

Share this post


Link to post
Share on other sites

Put all the commands in a server side addon as functions, then call the call the functions from scripts in the map. No one will have access to the addon besides the server admins, and that will contain the password.

Some interesting things you could do with this:

Create dynamic campaigns in multiplayer using the "#mission" command, called from within the map based on an objective being completed/failed.

Kicking players should they violate some rule on an RPG map, automatically

Edited by MH6

Share this post


Link to post
Share on other sites

I will have to look more into doing an addon based thing for the server as I've never touched addon making yet.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×