Hey guys,
I was wondering if it was possible to send a message of the same type as the warmup message in CS:GO to a player.
I've read at some places that it's a client side message, so I'm not sure we can do anything about it.
[CS:GO] Warmup HudDestination
Re: [CS:GO] Warmup HudDestination
Not sure about the warmup message specifically, but you can get something that resembles that:
Here's an example:
The message should stay on the player's screen until the round ends. If you want to remove it beforehand - just send an empty message:
One thing to note is that the message is shown after a one second delay. Oh and another thing, you can use some HTML tags to style the text, I've only messed around with the color though:
Edit: Added a try/catch in case an invalid index was specified.
Syntax: Select all
# ../win_message/win_message.py
# Source.Python
from events.manager import game_event_manager
from players.entity import Player
def send_win_message(message='', recipients=None):
"""Creates and sends the 'cs_win_panel_round' event.
Args:
message (str): Message to send, supports some HTML tags.
recipients: List/tuple of player indexes that should receive the
message.
"""
event = game_event_manager.create_event('cs_win_panel_round')
event.set_string('funfact_token', message)
# Should the message be sent to everyone on the server?
if recipients is None:
game_event_manager.fire_event(event)
# Or have the recipients been specified?
else:
for index in recipients:
try:
# Try to get a Player instance.
Player(index).base_client.fire_game_event(event)
except ValueError:
continue
# When firing events to players/clients directly, we need to free it
# once we're done with it.
game_event_manager.free_event(event)
Here's an example:
Syntax: Select all
from commands import CommandReturn
from commands.client import ClientCommand
@ClientCommand('win_msg')
def win_msg_cmd(command, index):
send_win_message(
message='One line..\nTwo lines..\nThree lines?!',
recipients=(index,)
)
return CommandReturn.BLOCK

The message should stay on the player's screen until the round ends. If you want to remove it beforehand - just send an empty message:
Syntax: Select all
# The 'message' argument is an empty string by default. Just specify from which
# player(s) you want to remove the message/panel.
send_win_message(recipients=(index,))
One thing to note is that the message is shown after a one second delay. Oh and another thing, you can use some HTML tags to style the text, I've only messed around with the color though:
Syntax: Select all
# This will be sent to everyone.
send_win_message(
message='<font color="#FF0000">RED TEXT, MUST BE IMPORTANT</font>')
Edit: Added a try/catch in case an invalid index was specified.
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 87 guests