AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   message functions confusion (https://forums.alliedmods.net/showthread.php?t=159883)

urban_ninja 06-23-2011 01:18

message functions confusion
 
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.

fysiks 06-23-2011 02:30

Re: message functions confusion
 
Quote:

Originally Posted by urban_ninja (Post 1493931)
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.

Arkshine 06-23-2011 02:35

Re: message functions confusion
 
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.

DjOptimuS 06-23-2011 02:49

Re: message functions confusion
 
http://wiki.alliedmods.net/Half-Life_1_Game_Events#StatusIcon

let's pick
StatusIcon

write_byte()
write_string()
write_byte()
write_byte()
write_byte()


All times are GMT -4. The time now is 23:34.

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