Changing the csgo disconnect message

All other Source.Python topics and issues.
NosferatuJoe
Junior Member
Posts: 17
Joined: Thu Jan 28, 2021 3:54 pm

Changing the csgo disconnect message

Postby NosferatuJoe » Mon Mar 08, 2021 8:41 pm

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..
Attachments
csgo_ik0m2iZoCu.png
csgo_ik0m2iZoCu.png (12.25 KiB) Viewed 5406 times
User avatar
VinciT
Senior Member
Posts: 331
Joined: Thu Dec 18, 2014 2:41 am

Re: Changing the csgo disconnect message

Postby VinciT » Wed Mar 10, 2021 7:35 pm

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"
ImageImageImageImageImage

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 8 guests