Sub Menu
Posted: 25 Aug 2018, 05:07
Im trying to make a menu that will Display in ze main menu
Can someone show me how todo this.
I want to hit M and will display
1. Weapons
2. Extra Items
3. Custom Models
Then when i hit 3 for Custom Models it display
1. Human Models
2. Zombie Models
Then when i hit 1 it shows all the Human Models.
Can someone show me how todo this.
I want to hit M and will display
1. Weapons
2. Extra Items
3. Custom Models
Then when i hit 3 for Custom Models it display
1. Human Models
2. Zombie Models
Then when i hit 1 it shows all the Human Models.
- #include <zombie_escape>
- native ze_open_knife_menu(id)
- native ze_open_zskin_menu(id)
- // Keys
- const OFFSET_CSMENUCODE = 205
- const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
- public plugin_natives()
- {
- register_native("ze_open_models_menu", "native_ze_open_models_menu", 1)
- }
- public plugin_init()
- {
- register_plugin("[ZE] Models Main Menu", ZE_VERSION, AUTHORS)
- // Commands
- register_clcmd("say /models", "Show_models_Menu")
- register_clcmd("say_team /models", "Show_models_Menu")
- // Register Menus
- register_menu("Main Model Menu", KEYSMENU, "Main_Models_Menu")
- }
- // Main Menu
- public Show_Menu_Models_Main(id)
- {
- static szMenu[250]
- new iLen
- // Title
- iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "Custom Models Menu")
- // 1. Human Models
- if (is_user_alive(id))
- {
- iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r3.\y Human Models^n^n")
- }
- else
- {
- iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d3. Human Models^n^n")
- }
- // 2. Zombie Models
- if (is_user_alive(id))
- {
- iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\r4.\y Zombie Models^n")
- }
- else
- {
- iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d4. Zombie Models^n")
- }
- // 0. Exit
- iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\w0.\y %L", id, "EXIT")
- // Fix for AMXX custom menus
- set_pdata_int(id, OFFSET_CSMENUCODE, 0)
- show_menu(id, KEYSMENU, szMenu, -1, "Main Model Menu")
- }
- // Main Menu
- public Main_Models_Menu(id, key)
- {
- // Player disconnected?
- if (!is_user_connected(id))
- return PLUGIN_HANDLED
- switch (key)
- {
- case 0: // Human Models
- {
- if (is_user_alive(id))
- {
- ze_open_zskin_menu(id)
- }
- }
- case 1: // Zombie Models
- {
- if (is_user_alive(id))
- {
- ze_open_knife_menu(id)
- }
- }
- }
- return PLUGIN_HANDLED
- }
- public native_ze_open_models_menu(id)
- {
- Show_Menu_Models_Main(id)
- }