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
}