Raised This Month: $ Target: $400
 0% 

message_begin (Sending a message)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Humming Bird
Junior Member
Join Date: May 2007
Old 06-01-2007 , 23:12   message_begin (Sending a message)
Reply With Quote #1

Hello, and I'm getting unsuccessful results with this code (to try to send a mod-specific HUD message)

Code:
    message_begin( MSG_ONE, 13, {0,0,0}, 1 );
        write_byte( 0 ); //InfoMsg
        write_string( "Test" ); //Title of HUDMessage
        write_string( "Testing" ); //Content of HUDMessage
    message_end();
Where 13 is g_netmsg[NETMSG_HUDMSG]
And 1 is me (when I'm alone on my own server)


Anyone know what I'm doing wrong?
Humming Bird is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 06-02-2007 , 00:24   Re: message_begin (Sending a message)
Reply With Quote #2

Try:

Code:
message_begin(MSG_ONE_UNRELIABLE,get_user_msgid("SayText"),_,id) write_byte(id) write_string("Test") // Title write_string("Testing") // Contents message_end()

Also, check the syntax for the sending of SayText. I looked it up and it looks like you've got it all wrong since it's not #13: http://wiki.alliedmods.net/Half-Life...Events#SayText

Parameter 1 is the sender id, and I don't think 0 works (it might, dunno).

If it's for a specific mod, though, it's possible it is #13. Either way, it's bad to hard code messages like that.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 10:40.


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