Raised This Month: $ Target: $400
 0% 

Menu to menu?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Drak
Veteran Member
Join Date: Jul 2005
Old 05-16-2006 , 20:47   Menu to menu?
Reply With Quote #1

I was making a gun buy menu, but when they select the gun type how do I make it go to another menu displaying the guns? Here's my current code.
Code:
new g_Menu   public plugin_init()   {       register_plugin(PLUGIN, VERSION, AUTHOR)             register_clcmd("say /guns", "Menu_Command")             g_Menu = menu_create("Weapon menu", "Menu_Handle")       menu_additem(g_Menu, "Pistol", "1")       menu_additem(g_Menu, "SMG", "2")       menu_additem(g_Menu, "Rifle", "3")       menu_additem(g_Menu, "Other", "4") }   public Menu_Command(id, level, cid)   {       menu_display(id, g_Menu, 0)             return PLUGIN_HANDLED   }   public Menu_Handle(id, Menu, Item)   {       new szCommand[3],  Accesss, Callback             menu_item_getinfo(Menu, Item, Accesss, szCommand, 2, _, _, Callback)             switch(szCommand[0])       {           case '-':           {               return PLUGIN_HANDLED           }                     case '1':           {               client_print(id,print_chat,"No function yet")         }                     case '2':           {                client_print(id,print_chat,"No function yet")         }                     case '3':           {             client_print(id,print_chat,"No function yet")         }                     case '4':           {               client_print(id,print_chat,"No function yet")         }                   }             return PLUGIN_HANDLED   }
__________________
Oh yeah
Drak is offline
Send a message via MSN to Drak
SubStream
Veteran Member
Join Date: Aug 2005
Location: USA
Old 05-18-2006 , 15:33  
Reply With Quote #2

I don't build menus that way using menu_additem but if you want to redo from scratch I would suggest doing you rmenu in the same format as ataccfg.amxx

If you look at the way they did their menu and use it as an outline you can't go wrong. It's pretty simple to understand if you take the time to look at it.
SubStream is offline
Freddy
Junior Member
Join Date: Mar 2006
Old 05-19-2006 , 01:10  
Reply With Quote #3

woah
__________________
The World Evolves Around us all.. Untill you Die!

[img]http://forums.protocol42.com/images/rank/rank_dev.gif
[/img]
Freddy is offline
Major_victory
Member
Join Date: Nov 2005
Location: Illinois
Old 10-01-2006 , 00:23   Re: Menu to menu?
Reply With Quote #4

Create the sub menus first. add a call funtion for each, and add a handler function for each. then in your main menu use the switch statement to call the submenu like you would the first.

Code:
//Setup the Pistols menu here
 
public Menu_Pistols(id, level, cid)  
{  
    menu_display(id, g_PistolMenu, 0)
    return PLUGIN_HANDLED  
} 
 
//Then in the Menu_Handle switch statement use
case '1':  
        {  
            Menu_Pistols()        
        }
I hope I wrote this understandably, btw because of you i finally figured out how to retrive what button was being sent, Thx man
__________________
Games i've screwed with:
Battlefield 1942, CNC Generals, Red Faction, Incoming/Incoming Forces, The Sims, Sim City 3k, Unreal Tournament, Fallout 1/2, Ragnarok, Goonzu, and CS 1.6.
Major_victory is offline
Send a message via AIM to Major_victory Send a message via Yahoo to Major_victory
stupok
Veteran Member
Join Date: Feb 2006
Old 10-01-2006 , 02:43   Re: Menu to menu?
Reply With Quote #5

@Sixtwin

I'd really appreciate it if you posted the working version of this plugin when you are done adding to it, because I could make use of it on my server with a few modifications
stupok 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 16:30.


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