Page 1 of 1

HudMsg immediately disappears

Posted: Tue May 31, 2022 4:52 pm
by qPexLegendary
I want to show after player spawn which site the terrorists need to attack.
But after sending first time HudMsg immediately disappears.

Video: https://youtu.be/R7wVJ5Z_InM

Syntax: Select all

player = Player(player_index)

Fade(
duration=1,
hold_time=1,
color=Color(),
flags=FadeFlags.IN,
).send(player_index)

current_site = "A" if Site.A == self.plant else "B"
if player.get_team_name() == 't':
message = "Attack site {}!".format(current_site)
color = Color(255, 0, 0)
else:
message = "Secure site {}!".format(current_site)
color = Color(0, 0, 255)

HudMsg(
message=message,
fade_in=0.1,
hold_time=1.5,
fade_out=0.5,
x=0.4,
y=0.4,
color1=color,
channel=8
).send(player_index)


Fade does not affect this.

Event: 'player_spawn'

Re: HudMsg immediately disappears

Posted: Tue May 31, 2022 5:39 pm
by L'In20Cible
Whenever a new round starts, the game send a ResetHUD message to all players in order to remove messages from the last round. Delay your message by a few frames so that it is being sent after that reset.

Re: HudMsg immediately disappears

Posted: Wed Jun 01, 2022 12:48 am
by qPexLegendary
Thanks