Raised This Month: $ Target: $400
 0% 

menus


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kensai
Veteran Member
Join Date: Aug 2005
Location: San Diego, California
Old 11-09-2005 , 00:49  
Reply With Quote #1

Start with this in your plugin_init:

Code:
register_menucmd(register_menuid("menu_NAMEHERE"),1023,"DoNAMEHERE");

You also need someway to go to the menu. Let's use a say command.

Code:
register_clcmd("say /menu","NAMEHERE")//Normal chat     register_clcmd("say_team /menu","NAMEHERE")//Team chat

Then make a public, to format the menu.

Code:
public NAMEHERE(id)     {           new menu[192]       format(menu, 191, "TITLE: WHAT TO DO^n1. Option 1^n2. Option 2^n3 Option 3^n^n0. Exit")         new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_0     show_menu(id, keys, menu, 15, "menu_NAMEHERE")             return PLUGIN_HANDLED }


Then we need to define the "cases" or what happens when a button is pressed.


Code:
public DoChooseType(id, key)     {         if(key == 0) {                 //Code here for Option 1     }                 if(key == 1) {                 //Code here for Option 2     }         if(key == 2) {                 //Code here for Option 3     }             if(key == 0) {         //This Exits the Menu, when they hit Exit.         return PLUGIN_HANDLED     }         return PLUGIN_HANDLED }
Kensai is offline
Send a message via AIM to Kensai Send a message via MSN to Kensai
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 23:39.


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