Raised This Month: $ Target: $400
 0% 

Menu to change knives


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wickedd
Veteran Member
Join Date: Nov 2009
Old 05-04-2013 , 12:26   Re: Menu to change knives
Reply With Quote #1

You can start by reading this.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
danonix
Senior Member
Join Date: Dec 2012
Old 05-04-2013 , 16:28   Re: Menu to change knives
Reply With Quote #2

Thanks for the link, I think this menu would be the best there, wouldn't be it?

But I should make there 4~ handlers, for each one 5 choices. Isn't there a simplier way?
Code:
 #include <amxmodx>   public plugin_init()  {     register_clcmd( "my_awesome_menu","AwesomeMenu" );  }  public AwesomeMenu( id )  {     new menu = menu_create( "\rLook at this awesome Menu!:", "menu_handler" )      //Note that our data is 'm' to know it is from the main menu     menu_additem( menu, "\wI'm Selection #1", "m", 0 );     menu_additem( menu, "\wGo to SubMenu", "m", 0 );      menu_display( id, menu, 0 );  }  SubMenu( id )  {     new menu = menu_create( "\rLook at this awesome Sub-Menu!:", "menu_handler" )      //Note that our data is 's' to know it is from the sub menu     menu_additem( menu, "\wI'm Sub-Selection #1", "s", 0 );     menu_additem( menu, "\wI'm Sub-Selection #2", "s", 0 );      menu_display( id, menu, 0 );  }  public menu_handler( id, menu, item )  {     if ( item == MENU_EXIT )     {         menu_destroy( menu );         return PLUGIN_HANDLED;     }      new szData[6], szName[64];     new item_access, item_callback;     menu_item_getinfo( menu, item, item_access, szData,charsmax( szData ), szName,charsmax( szName ), item_callback );      //Switch based on the first character of the data ( the 'm' or the 's')     switch( szData[0] )     {         //All our main menu data will be handled in this case         case 'm':         {             switch( item )             {                 case 0:                 {                     client_print( id, print_chat, "Hooray! You selected the Awesome 1st Selection" );                 }                 case 1:                 {                     SubMenu( id );                 }             }         }         //All our sub menu data will be handled in this case         case 's':         {             switch( item )             {                 case 0:                 {                     client_print( id, print_chat, "Hooray! You selected the Awesome 1st Sub-Selection" );                 }                 case 1:                 {                     client_print( id, print_chat, "OH NO! You selected the Awesome 2nd Sub-Selection! BEWARE!" );                 }             }              //Note that this is still only for our sub menu             AwesomeMenu( id );         }     }      menu_destroy( menu );     return PLUGIN_HANDLED;  }


Last edited by danonix; 05-04-2013 at 16:29.
danonix 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 10:51.


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