Raised This Month: $ Target: $400
 0% 

Gamemenu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Korxu
Senior Member
Join Date: Sep 2010
Old 11-21-2011 , 17:36   Re: Gamemenu
Reply With Quote #3

I am using this:
PHP Code:

new gi_MessageIndex

public plugin_init ( )
{
     
register_message get_user_msgid "ShowMenu" ), "menu_team" )
     
register_message get_user_msgid "VGUIMenu" ), "vgui_team" )
}

public 
menu_team messagedestrec )
{
     new 
sz_MenuText 12 ]

     
get_msg_arg_string 4sz_MenuTextcharsmax sz_MenuText ) )

     if ( !
equal sz_MenuText"#Team_Select" ) )
     {
          return 
PLUGIN_CONTINUE
     
}

     
set_pdata_int rec205)

     
gi_MessageIndex message

     
// Now, you call to your custom menu, example:
     // custom_menu ( rec )

     
return PLUGIN_HANDLED
}

public 
vgui_menu messagedestrec )
{
     if ( 
get_msg_arg_int ) != )
     {
          return 
PLUGIN_CONTINUE
     
}

     
gi_MessageIndex message

     
// The same, send your custom menu here ( the same example ):
     // custom_menu ( rec )

     
return PLUGIN_HANDLED
}

// And now use this stock in the handler of your custom menu to change the player team:

/*
** @param1     - Player index.
** @param2     - Team number ( 1 = T, 2 = CT, 6 = SPECT ).
** @param3     - Player class.
*/

// *NOTE* You can use only "change_team ( index )" to move a player to the spects team.

stock change_team index, const team [ ] = "5", const class [ ] = "0" )
{
     new 
i_MessageBlock

     i_MessageBlock 
get_msg_block gi_MessageIndex )

     
set_msg_block gi_MessageIndexBLOCK_SET )

     
engclient_cmd index"jointeam"team )
     
engclient_cmd index"joinclass", class )

     
set_msg_block gi_MessageIndexi_MessageBlock )

Korxu is offline
 



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 08:34.


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