AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Exploring Game User Messages (https://forums.alliedmods.net/showthread.php?t=54930)

Silencer123 05-08-2007 07:18

Exploring Game User Messages
 
When in a game and typing meta game in console you get a list of all Game User Messages.
These can be hooked via the register_event function. My question is how I may find out what
is what in that message. I see the messages sizes. A message with size of 1 has one value
coming with it I guess, a message with size of 0 comes with nothing? And what about those
with a size of -1? And how can I carefully find out what is an integer/float/string?
When I tried to do that with one message it just crashed my game.

mogel 05-08-2007 07:47

Re: Exploring Game User Messages
 
Hi,

http://wiki.amxmodx.org/index.php/Ha..._1_Game_Events
http://forums.alliedmods.net/showthread.php?p=65983

hand, mogel

VEN 05-08-2007 07:53

Re: Exploring Game User Messages
 
Use

register_message
get_msg_args
get_msg_argtype
etc

See messages.inc for details.

regalis 05-08-2007 08:34

Re: Exploring Game User Messages
 
This link may also be helpfull ;)
http://forums.alliedmods.net/showthr...ht=events+list

Orangutanz 05-08-2007 09:02

Re: Exploring Game User Messages
 
Or you can use SHPTools (in my sig), and setup relevent watching events which return correct values to use for each message.

Silencer123 05-08-2007 10:27

Re: Exploring Game User Messages
 
oh well thanks for the replies but just found out that the message I wanted to use is something
different than I thought. I wanted to use HudText Message to change a specific Hud Message,
but HudTxt message is for screen center printed messages only, which are predefined also.
I still do not know what a size of -1 means and it would be cool to have something
that could hook or even forward when a Hud Message appears.

VEN 05-11-2007 05:27

Re: Exploring Game User Messages
 
If this message is sent by a server to a client it can be hooked. If it isn't sent by a server but generated on the client based on some condition you can't hook it and you have to find that condition.

In general message size shows message size in bytes.

So for example Damage message consists of byte, byte, long, coord, coord, coord. Since long consists of 4 bytes and coord of 2 we will get: 1 + 1 + 4 + 2 + 2 + 2 == 12

Message size == -1 mean that size of this message wasn't specified on its registration. This usually mean that size of a message isn't fixed.


All times are GMT -4. The time now is 06:36.

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