Raised This Month: $ Target: $400
 0% 

ShowSyncHudMsg - HudSyncObject -1 is invalid...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 04-19-2007 , 04:22   ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #1

Hi i got a problem with "ShowSyncHudMsg" and don't see where the mistake is hidden.

Code:
#include <amxmodx>

new g_MsgSync;

public plugin_init()
{
    g_MsgSync = CreateHudSyncObj();
}


public function(id)
{
   set_hudmessage(192, 192, 192, -1.0, 0.45, 2, 0.02, 10.0, 0.01, 0.1, next_hudchannel(id));
   ShowSyncHudMsg(id, g_MsgSync, "blabla HUD-Message");
}
Now if my function is executed it gives me an runtime Error which says this
Quote:
L 04/19/2007 - 10:148: HudSyncObject -1 is invalid
L 04/19/2007 - 10:148: [AMXX] Displaying debug trace (plugin "test.amxx")
L 04/19/2007 - 10:148: [AMXX] Run time error 10: native error (native "ShowSyncHudMsg")
L 04/19/2007 - 10:148: [AMXX] [0] test.sma::function (line 207)
Why the heck is my HudSyncObject == -1 ??

I appreciate any help!
Thanks regalis
__________________

Last edited by regalis; 04-19-2007 at 04:22. Reason: typo
regalis is offline
pRED*
Join Date: Dec 2006
Old 04-19-2007 , 05:07   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #2

Why don't you just use show_hudmessage?
pRED* is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 04-19-2007 , 05:21   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #3

I use it right now, but i thought this is new and new things are better ;)

I understand that this way...if a plugin uses a hudchannel and mine would like to use the same(with show_hudmessage) with these new SyncObject it will switch to the next free channel...does i misunderstood something?


Thanks for your suggestion ;)
greetz regalis
__________________
regalis is offline
pRED*
Join Date: Dec 2006
Old 04-19-2007 , 06:22   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #4

You can still do that with show_hudmessage.

The last parameter of set_hudmessage is the 'channel' one. That can either be 1 of 4 channels or set it to -1 and it will try find you a free channel to display the hud message in
pRED* is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 04-19-2007 , 06:28   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #5

Quote:
Originally Posted by pRED* | NZ View Post
You can still do that with show_hudmessage.

The last parameter of set_hudmessage is the 'channel' one. That can either be 1 of 4 channels or set it to -1 and it will try find you a free channel to display the hud message in
Didn't know that -1 will search a free hudchannel!
Ok, then i will shred this f*ck*ng HudSyncObject *gg*

Thank you very much! You helped me a lot ;)

greetz regalis
__________________
regalis is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 04-19-2007 , 06:53   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #6

Quote:
Originally Posted by pRED* | NZ View Post
You can still do that with show_hudmessage.

The last parameter of set_hudmessage is the 'channel' one. That can either be 1 of 4 channels or set it to -1 and it will try find you a free channel to display the hud message in
That still doesn't stop other plugins from using that "free" [for a limited time] hud message you poo nugget.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 04-19-2007 , 07:03   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #7

Quote:
Originally Posted by Zenith77 View Post
That still doesn't stop other plugins from using that "free" [for a limited time] hud message you #!%?$.
Hmm, then i should use ShowSyncHudMsg?
Now im confused

Can you tell me what i have done wrong in my code above?
Why is HudSyncObject = -1?
And what should it be!?..0o

Thanks for helping
regalis


PS: If you need more code i'll be back in the evening, now i have to go offline because of reallife shit
__________________

Last edited by regalis; 04-19-2007 at 07:04. Reason: typo...0o
regalis is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-19-2007 , 07:12   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #8

Try replace plugin_init() with plugin_precache() - i'm not saying that this is a solution but i'm trying to find where is the problem.
VEN is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 04-19-2007 , 07:30   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #9

I'll try that in the evening...when i'm back home...thanks
I'll report if it works or not...if it works the documentary is wrong ;)

greetz regalis
__________________
regalis is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 04-19-2007 , 11:48   Re: ShowSyncHudMsg - HudSyncObject -1 is invalid...
Reply With Quote #10

Some other plugins may have already reserved HudObj's, try disabling some. And add a check in plugin_init() to see if it's -1.
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:05.


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