Raised This Month: $ Target: $400
 0% 

[ Solved ] message_begin , write_byte ...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-24-2012 , 06:40   [ Solved ] message_begin , write_byte ...
Reply With Quote #1

I did not comment everything that I do not understand otherwise I would comment on each line (lol)

What's the useful to do this ?

Code:
make_ScreenFade(client,duration,holdtime,flags,r,g,b,a) // What is that ? {     message_begin(MSG_ONE,ScreenFade,_,client);     write_short(duration); // duration ?     write_short(holdtime); // holdtime ?     write_short(flags); // Flags ?     write_byte(r); // r ?     write_byte(g); // g ?     write_byte(b); // b = blue ? Why ?     write_byte(a); // a ?     message_end(); }


And what's the useful to do this too ?

Code:
public beacon(id) // What is that ? Why beacon ? lol {     if(cs_get_user_team(id) == CS_TEAM_CT)     {         static origin[3]         get_user_origin(id,origin)         message_begin(MSG_BROADCAST,SVC_TEMPENTITY) // ?         write_byte(TE_BEAMCYLINDER)         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2]-20) // Why -20 for the origin[2] ?         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2]+200)         write_short(beacon_sprite) // Sprite ?         write_byte(0)         write_byte(1) // Why 1 and not 100000 ?         write_byte(6)         write_byte(2) // And 2 here ?         write_byte(1)           write_byte(0) // And why we do not set write_byte(0) before write_byte(6) for example ?         write_byte(0)         write_byte(250) // And 250 ?         write_byte(200)         write_byte(0) // Why 0 ?         message_end()     }     else     {         static origin[3]         get_user_origin(id,origin)         message_begin(MSG_BROADCAST,SVC_TEMPENTITY)         write_byte(TE_BEAMCYLINDER)         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2]-20)         write_coord(origin[0])         write_coord(origin[1])         write_coord(origin[2]+200)         write_short(beacon_sprite)         write_byte(0)           write_byte(1)         write_byte(6)         write_byte(2)         write_byte(1)         write_byte(250)         write_byte(0)         write_byte(0)         write_byte(200)         write_byte(0)         message_end()     }     set_task(1.0,"beacon",id) // Why a task here ? }


I've read and read a lots the funcwiki but I'm completely lost from there. Can someone help me please ?

Thanks It's very important for me to understand that certainly

Ps: I read http://www.amxmodx.org/funcwiki.php?go=func&id=262 , http://www.amxmodx.org/funcwiki.php?go=func&id=264 ... and others
__________________
Pawn ? Useless

Last edited by Aooka; 06-24-2012 at 06:40.
Aooka is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-24-2012 , 06:45   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #2

Check the wiki : http://wiki.amxmodx.org/Half-Life_1_Game_Events
__________________
Arkshine is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-24-2012 , 07:56   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #3

I go look this. Thank you.
__________________
Pawn ? Useless
Aooka is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-27-2012 , 07:00   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #4

I read it a long time and i do not undertand how it's working.

Code:
#include < amxmodx > public plugin_init( ) {     register_clcmd( "say /menu" , "CmdMenu" );         new const iMenu = menu_create( "My new menu" , "Handler_Menu" );     menu_additem( iMenu , "Test 1" , "1" , 0 );     menu_additem( iMenu , "Test 2" , "2" , 0 );     menu_additem( iMenu , "Test 3" , "3" , 0 ); } public CmdMenu( id ) {     if( !is_user_alive( id ) )         return 1;             else         menu_display( id , iMenu , 0 ); } /*     public myfunction( ... )     {         And here i whant to use it to custom my menu : <a href="http://wiki.amxmodx.org/Half-Life_1_Game_Events#ShowMenu" target="_blank" rel="nofollow noopener">http://wiki.amxmodx.org/Half-Life_1_...vents#ShowMenu</a>         But i really do not understand ... So if someone can do that it will be very helpfull for me ! Thanks all     } */

Or if it's not possible with that http://wiki.amxmodx.org/Half-Life_1_...vents#Scenario or http://wiki.amxmodx.org/Half-Life_1_Game_Events#Radar

Thank you in advance ! I look a lot's of plugin but it do not help me.
__________________
Pawn ? Useless
Aooka is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-27-2012 , 07:10   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #5

If you want to learn how to build menus, read the existing tutorials..
__________________
Arkshine is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-27-2012 , 07:25   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #6

I know how to build a menu but not with (http://forums.alliedmods.net/showthr...4#MenuCallback)
Code:
write_byte( .. )
for example
__________________
Pawn ? Useless

Last edited by Aooka; 06-27-2012 at 07:26.
Aooka is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-27-2012 , 07:56   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #7

In relation to your first post, bytes must be sent in a certain order because they are read in a certain order.

The second piece of code you posted is a popular function used for Jailbreak ( Last Request - to show a coloured ring around the competing players ), it is, however, inefficient, the team check should only be used to determine the sprite colour bytes through a switch statement, rather than having an else and all the bytes written out again.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 06-27-2012 at 07:57.
hornet is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-27-2012 , 08:15   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #8

yes thanks a lot but I would like to use this but I do not have the opportunity...

I do not know what to do as a code to use this...
__________________
Pawn ? Useless
Aooka is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-27-2012 , 08:25   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #9

Make menus with the existing natives, not with messages.
__________________
<VeCo> is offline
Aooka
Veteran Member
Join Date: Aug 2011
Location: Villeurbanne
Old 06-27-2012 , 08:31   Re: [ Request ] message_begin , write_byte ...
Reply With Quote #10

what do you mean by "existing natives" ?
__________________
Pawn ? Useless
Aooka is offline
Reply


Thread Tools
Display Modes

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:17.


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