Raised This Month: $ Target: $400
 0% 

Exploring Game User Messages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Silencer123
Veteran Member
Join Date: Jul 2006
Old 05-08-2007 , 07:18   Exploring Game User Messages
Reply With Quote #1

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.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
mogel
Senior Member
Join Date: Jan 2007
Old 05-08-2007 , 07:47   Re: Exploring Game User Messages
Reply With Quote #2

Hi,

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

hand, mogel
__________________
mogel is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-08-2007 , 07:53   Re: Exploring Game User Messages
Reply With Quote #3

Use

register_message
get_msg_args
get_msg_argtype
etc

See messages.inc for details.
VEN is offline
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 05-08-2007 , 08:34   Re: Exploring Game User Messages
Reply With Quote #4

This link may also be helpfull ;)
http://forums.alliedmods.net/showthr...ht=events+list
__________________
regalis is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 05-08-2007 , 09:02   Re: Exploring Game User Messages
Reply With Quote #5

Or you can use SHPTools (in my sig), and setup relevent watching events which return correct values to use for each message.
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
Silencer123
Veteran Member
Join Date: Jul 2006
Old 05-08-2007 , 10:27   Re: Exploring Game User Messages
Reply With Quote #6

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.
__________________
EAT YOUR VEGGIES
Silencer123 is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 05-11-2007 , 05:27   Re: Exploring Game User Messages
Reply With Quote #7

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.

Last edited by VEN; 05-11-2007 at 05:33.
VEN 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 06:36.


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