Raised This Month: $51 Target: $400
 12% 

Is there any way to kick all players with one command?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drek
Member
Join Date: Mar 2004
Old 12-08-2008 , 19:55   Is there any way to kick all players with one command?
Reply With Quote #1

Just that. I searched the forums, honest I did. I looked through the wiki, and I couldn't find it - that doesn't mean it isn't there, I just couldn't find it. SourceMod has the @humans option for commands, is there anything equivalent for AMXX? I just want to be able to kick all the human players on my server with a reason before it shuts down. It needs to be a console command because I want to do it in a script.

Thanks in advance.
Drek is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 12-08-2008 , 19:58   Re: Is there any way to kick all players with one command?
Reply With Quote #2

Nope. You will need to request a new plugin for it if it doesn't exist already
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Drek
Member
Join Date: Mar 2004
Old 12-08-2008 , 20:04   Re: Is there any way to kick all players with one command?
Reply With Quote #3

Thanks for the response. Seems to me that the AdminMod plugin has execall functionality. Didn't want to install another plugin, but maybe I'll check that out.
Drek is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-08-2008 , 20:14   Re: Is there any way to kick all players with one command?
Reply With Quote #4

Quote:
Originally Posted by Drek View Post
Thanks for the response. Seems to me that the AdminMod plugin has execall functionality. Didn't want to install another plugin, but maybe I'll check that out.
Execall does not execute server commands, but commands on the players console. You can call 'disconnect', for all players, for example, but they won't see the reason.

A good way is to use amx_csay/amx_tsay to show a HUD message to all players with the reason for the shutdown. Let it display for like 30 seconds, then close the server.
__________________

Community / No support through PM
danielkza is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-08-2008 , 20:32   Re: Is there any way to kick all players with one command?
Reply With Quote #5

You can use something that, it will disconnects them but with a message ( 3 lines max ) :

Code:
    message_begin ( MSG_BROADCAST, SVC_DISCONNECT );     write_string ( "^nHello word!^nServer is being is being restarted^nWhaou!" );     message_end ();

Though, I'm not sure if it will work on all players using MSG_BROADCAST, otherwise, just do a loop through all players using MSG_ONE. ( message_begin ( MSG_ONE, SVC_DISCONNECT, _, id ); )
__________________
Arkshine is offline
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-08-2008 , 20:41   Re: Is there any way to kick all players with one command?
Reply With Quote #6

Quote:
Originally Posted by arkshine View Post
You can use something that, it will disconnects them but with a message ( 3 lines max ) :

Code:
message_begin ( MSG_BROADCAST, SVC_DISCONNECT ); write_string ( "^nHello word!^nServer is being is being restarted^nWhaou!" ); message_end ();


Though, I'm not sure if it will work on all players using MSG_BROADCAST, otherwise, just do a loop through all players using MSG_ONE. ( message_begin ( MSG_ONE, SVC_DISCONNECT, _, id ); )
Oh, I was looking for something like this. I didn't know how to kick a player without showing the 'Kicked' text. Just to be sure, do I still need to call 'kick #id' or the message forces the client to disconnect?
__________________

Community / No support through PM
danielkza is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-08-2008 , 21:11   Re: Is there any way to kick all players with one command?
Reply With Quote #7

You don't need to call the kick command, but such message is using by this one, so you will still see the text "Kicked: you have... etc.."
What is good with that, is you can write on 3 lines max.
__________________
Arkshine is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 12-08-2008 , 21:13   Re: Is there any way to kick all players with one command?
Reply With Quote #8

There's kind of a command for that. I think it's amx_tag or something. It's not designed to kick everyone, but if you use it properly it will.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
BigNEO
Member
Join Date: Sep 2006
Old 12-08-2008 , 21:55   Re: Is there any way to kick all players with one command?
Reply With Quote #9

HLSW has a function that kicks all players on map change.
__________________
Clan [DPS] CS 1.6 server w/GG option

72.51.60.122:27015

www.DPS-CLAN.NING.com
BigNEO is offline
Drek
Member
Join Date: Mar 2004
Old 12-10-2008 , 08:37   Re: Is there any way to kick all players with one command?
Reply With Quote #10

Well, what I wanted to do was kick all players with a reason before a server shutdown, so they wouldn't be left with a hanging client that looked like a crash or a network problem. What I discovered was that if you use the "exit" command in the console to shut down the server, HLDS/SRCDS does it for you.

(I realize the following is a bit OT as far as AMXX goes, but it is the answer to the question I was asking so I'll include my solution in case others are looking for it.)

So the next step was to figure out a way to use the exit command from a script, which I figured out with some help from the Linux hlds mailing list. Just for the sake of thoroughness, in case anyone else is looking for the information, I use screen, and the following screen command format allows me to basically execute any console command, including AMXX/SM commands, from a bash script, or from the SSH console, without having to attach to the running screen.

This is just a rough cut from the bash script (the actual script is much more complicated, but that's the nut of what I was trying to do, and you can replace the command with any command, including the "exit" command:

Code:
message="I fart in your general direction!"
command="amx_csay $message\015"
su -c "screen -S hlds -p 0 -X eval 'stuff 
\"$command\"'" cc-server
The implications of this are pretty huge for me. All I would need to do is figure out how to query the server from a bash script, and I could easily create a fairly simple script that would allow me to admin my server without having to attach to the screen.

In case anyone is wondering why I would bother going to the trouble when I can just attach to the screen and execute the commands? What started this was that my shutdown script runs on cron (like the Task Scheduler in Windows), so I wanted to do this from a script, the other factor is that, it is extremely easy to accidentally shut down your server if you are working with the console inside a screen.

There are a couple of ways that are habitual for me that would be extremely easy for me to do without thinking. If I can admin from a script, this lowers the potential for that kind of thing. Also, as anyone who has worked with the hlds/srcds console, it is easy to get confused when entering commands into a console if the server is busy, because the constant flow of messages which actually push the command prompt around.

Last edited by Drek; 12-10-2008 at 08:39.
Drek is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 13:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode