Info Message
Info Message
Hello. I want a message like "Match started" on the top center of screen.
But HintText, SayText2 not what I need. Please help me of code example.
But HintText, SayText2 not what I need. Please help me of code example.
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Syntax: Select all
from events import Event
from messages import TextMsg
game_started = TextMsg(message='Game started',
destination=TextMsg.HUD_PRINTCENTER)
@Event
def round_start(game_event):
game_started.send()
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Actually, there is no "msg_name" for TextMsg:It seems that the first string wrote to "params" is the main string and others are just formated to it.
EDIT: HintText and KeyHintText both works on my side. I think I know why they didn't, on your side. Like I commented here, ResetHud is sent every round start to clean players' hud so you need to delay any HintText/KeyHintText if you want to send them on round_start.
Syntax: Select all
message CCSUsrMsg_TextMsg
{
optional int32 msg_dst = 1;
repeated string params = 3;
}
EDIT: HintText and KeyHintText both works on my side. I think I know why they didn't, on your side. Like I commented here, ResetHud is sent every round start to clean players' hud so you need to delay any HintText/KeyHintText if you want to send them on round_start.
I noticed that too. However, I also noticed this post of your's from a while back (dev eyes only):
http://forums.sourcepython.com/showthread.php?202&p=1260&viewfull=1#post1260
The link in your second edit led me to the conclusion that maybe we needed another value. Through all my testing, the only one that does not crash my client is when I have both msg_name and params. Though, again, nothing is printed.
I will continue to test, and see if I can figure this out.
http://forums.sourcepython.com/showthread.php?202&p=1260&viewfull=1#post1260
The link in your second edit led me to the conclusion that maybe we needed another value. Through all my testing, the only one that does not crash my client is when I have both msg_name and params. Though, again, nothing is printed.
I will continue to test, and see if I can figure this out.
Not sure if this has something to do with this issue. https://github.com/Source-Python-Dev-Team/Source.Python/issues/4
I never had the motivation to take a look at it.
I never had the motivation to take a look at it.
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Actually, I got it working with the following:However, this is the same result as HintText and KeyHintText. They all three prints the message at this area: http://img15.hostingpics.net/pics/5258302014111000001.jpg
Syntax: Select all
from events import Event
from filters.recipients import RecipientFilter
from _messages import UserMessage
@Event
def player_jump(game_event):
x = RecipientFilter() # Need to keep it alive the time send_message gets called.
msg = UserMessage(x, 'TextMsg')
msg.set_byte('msg_dst', 4)
msg.set_string('params', 'Hello!', 1)
msg.send_message()
Even though it is the same, we still need to support it within our messages package with the TextMsg class. When you get the chance, please update the data or package to fix this issue. And yes, Ayuto, we do still need to go back through and fix any other issues that exist within the messages package, especially in relation to CS:GO.
I need message like: "PLAYING ON TEAM COUNTER-STRIKE" on image http://img15.hostingpics.net/pics/5258302014111000001.jpg
Return to “Plugin Development Support”
Who is online
Users browsing this forum: No registered users and 139 guests