HudMsg immediately disappears

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
qPexLegendary
Junior Member
Posts: 5
Joined: Wed Apr 14, 2021 2:26 am
Location: Russia
Contact:

HudMsg immediately disappears

Postby qPexLegendary » Tue May 31, 2022 4:52 pm

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'
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: HudMsg immediately disappears

Postby L'In20Cible » Tue May 31, 2022 5:39 pm

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.
User avatar
qPexLegendary
Junior Member
Posts: 5
Joined: Wed Apr 14, 2021 2:26 am
Location: Russia
Contact:

Re: HudMsg immediately disappears

Postby qPexLegendary » Wed Jun 01, 2022 12:48 am

Thanks

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 37 guests