Page 1 of 1

Changing the csgo disconnect message

Posted: Mon Mar 08, 2021 8:41 pm
by NosferatuJoe
Hey SP community!

I had a simple question but can't find it anywhere when googling about it.
I'm looking for a way to change the message in the picture which is included in the attachments.

It's basically the message you get when your server restarts/crashes. I've seen some servers that have this message customized, so I know it's possible.

Thanks in advance!


PS: My csgo is in dutch, but you get the idea hehe..

Re: Changing the csgo disconnect message

Posted: Wed Mar 10, 2021 7:35 pm
by VinciT
One way to have a custom server shutdown message would be to kick all the players with the custom message, and then shut the server down:

Syntax: Select all

# ../shutdown_message/shutdown_message.py

# Source.Python
from commands.typed import TypedServerCommand
from engines.server import queue_command_string
from filters.players import PlayerIter


@TypedServerCommand('quit_ex')
def quit_extended(command, message):
"""Extended 'quit' server command with support for custom messages.

Args:
message (str): Disconnect message that's shown to the player(s).
"""
# Go through all players on the server.
for player in PlayerIter():
# Kick them with our custom message.
player.kick(message)

# Shut down the server.
queue_command_string('quit')
And then you can use the quit_ex command through the server console or rcon:

Code: Select all

quit_ex "Server is going down for maintenance"