Raised This Month: $ Target: $400
 0% 

message functions confusion


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
urban_ninja
Senior Member
Join Date: Feb 2009
Old 06-23-2011 , 01:18   message functions confusion
Reply With Quote #1

in the message_const.inc it show the color types but I dont see how amxx would know on its own which of the values between 0-255 its supposed to be.
// write_byte(red)
// write_byte(green)
// write_byte(blue)

But then if I specify the value like shown below how would amxx tell appart which one of those value is supposed to go towards red, blue or green?

write_byte(250)
write_byte(150)
write_byte(0)

Basicaly my confusion is write_byte, write_cood, write_shor,ect aren't unique fuctions and can be anything and shear logic of its use contradicts its self. On top of it the write_ fuctions hold only one value and it might make better sense if write_ functions was structured like other amxx functions where you have multiple param going into the function like 1 for what its supposed to be and the other for the value like for example write_byte(red, 255) wouldnt be confusing but unfortunately it not like that.

I plan on making a game play plugin that add new weapons and it can't made with out message functions. I have no clue how message functions and everything that associates with it completely work and where to begin. How does it all work? And im not just talking about general stuff like individual functions, Im talking about how does it all work to the point?

Please don't redirect me to wiki or anywhere else because I have looked there and the depth of the details is very shallow.
__________________
urban_ninja is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-23-2011 , 02:30   Re: message functions confusion
Reply With Quote #2

Quote:
Originally Posted by urban_ninja View Post
in the message_const.inc it show the color types but I dont see how amxx would know on its own which of the values between 0-255 its supposed to be.
// write_byte(red)
// write_byte(green)
// write_byte(blue)

But then if I specify the value like shown below how would amxx tell appart which one of those value is supposed to go towards red, blue or green?

write_byte(250)
write_byte(150)
write_byte(0)
They must always be in that order: red, green, blue. In fact, every write_* function must be in the correct order for the message to get built correctly.
__________________
fysiks is online now
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-23-2011 , 02:35   Re: message functions confusion
Reply With Quote #3

You think too much. Each messages are just parsed by the engine properly and redirected to the related function. It has nothing to with AMXX which sends just the message to the engine. So, you don't have exactly to know how the engine works, just use the message as you feel.
__________________
Arkshine is offline
DjOptimuS
Senior Member
Join Date: Jan 2009
Old 06-23-2011 , 02:49   Re: message functions confusion
Reply With Quote #4

http://wiki.alliedmods.net/Half-Life_1_Game_Events#StatusIcon

let's pick
StatusIcon

write_byte()
write_string()
write_byte()
write_byte()
write_byte()
DjOptimuS 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:34.


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