AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Writing 2 hudmessages at the same time (https://forums.alliedmods.net/showthread.php?t=162804)

Diegorkable 07-23-2011 07:06

Writing 2 hudmessages at the same time
 
I built in a mode of mine that when it reaches some point it types a hud message in blue, but at the meanwhile its about to come up, there's another hudmessage that refreshes every 1 seconds, so the blue message doesnt display because of thehudmessage that refreshes every 1 second....
How can I write them both at the same time without them refraining from each other to display?

.Dare Devil. 07-23-2011 07:19

Re: Writing 2 hudmessages at the same time
 
ShowSyncHudMsg mayby ?

Diegorkable 07-23-2011 07:20

Re: Writing 2 hudmessages at the same time
 
can you expand please and tell me more about it? and give me an example of a full use of this? with all parameters? I don't know that function, I know scripting very very good, but since im new to Pawn im new to its scripting functions aswell.

.Dare Devil. 07-23-2011 07:24

Re: Writing 2 hudmessages at the same time
 
PHP Code:

 
new g_MsgSync
 
public plugin_init()
{
          
g_MsgSync CreateHudSyncObj()


now you can show hud message like this :)

set_hudmessage(150, 0, 0, -1.0, -1.0, 1, 0.5, 2.0, 1.0, 1.0, -1)
ShowSyncHudMsg(id, g_MsgSync, "Your new hud message")

Diegorkable 07-23-2011 07:25

Re: Writing 2 hudmessages at the same time
 
And.... will it show it even if there's another HUD message displayed?

.Dare Devil. 07-23-2011 07:56

Re: Writing 2 hudmessages at the same time
 
Quote:

Originally Posted by Diegorkable (Post 1516590)
And.... will it show it even if there's another HUD message displayed?

Yeah, if you want 2 hud messages then just make like this

PHP Code:

 
new g_MsgSync2
 
public plugin_init()
{
          
g_MsgSync2 CreateHudSyncObj()


and

set_hudmessage(150, 0, 0, -1.0, -1.0, 1, 0.5, 2.0, 1.0, 1.0, -1)
ShowSyncHudMsg(id, g_MsgSync2, "Your new hud message")

then its working

SnoW 07-23-2011 09:44

Re: Writing 2 hudmessages at the same time
 
I believe sync huds are only useful if you wanted to ensure that you do not overwrite earlier message. Somehow because you want the messages to show at the same time, the correct way to do this is to use two channels. In case you did not still get it the channel is the last parameter in the setting native, so this should be different( or -1 how probably ) in the two messages.

Diegorkable 07-23-2011 09:45

Re: Writing 2 hudmessages at the same time
 
SnoW - can you give me an example of how to use the show_hudmessage to make them display at the same time?

SnoW 07-23-2011 10:46

Re: Writing 2 hudmessages at the same time
 
It is not about displaying but setting the hud message.

Code:
set_hudmessage( red=200, green=100, blue=0, Float:x=-1.0, Float:y=0.35, effects=0, Float:fxtime=6.0, Float:holdtime=12.0, Float:fadeintime=0.1, Float:fadeouttime=0.2, channel=4 );

The channel ( the last parameter ) should not be the same in the messages you want to show at the same time. Set the messages separately and set the both channels to -1.

Diegorkable 07-23-2011 10:57

Re: Writing 2 hudmessages at the same time
 
But if I want to put each hudmessage in another channel, why would I set them all to -1?


All times are GMT -4. The time now is 01:11.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.