AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   message_begin (Sending a message) (https://forums.alliedmods.net/showthread.php?t=55913)

Humming Bird 06-01-2007 23:12

message_begin (Sending a message)
 
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?

Hawk552 06-02-2007 00:24

Re: message_begin (Sending a message)
 
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.


All times are GMT -4. The time now is 10:40.

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