Raised This Month: $ Target: $400
 0% 

[Help] I opened the menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wEEk
Senior Member
Join Date: Sep 2012
Old 04-19-2013 , 19:15   [Help] I opened the menu
Reply With Quote #1

Hi ...

First, sorry my English

I wanted to ask what is wrong here, I put the sub menu and compiles fine. test when using the option number 2 and nothing happens.

Code ....


Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> public plugin_init() {     register_plugin("My Menu",AMXX_VERSION_STR,"SmileY");         register_clcmd("nightvision","cmdMenu",_,"- Show your custom menu"); } public cmdMenu(id) {     new MyMenu = menu_create("\r[ Base Builder ] \wOpciones:","MyHandler");         menu_additem(MyMenu,"Mejoras HM y ZM","0");     menu_additem(MyMenu,"Reglas","1");     menu_additem(MyMenu,"Opcion 3","2");     menu_additem(MyMenu,"Opcion 4","3");     menu_additem(MyMenu,"Opcion 5","4");     menu_additem(MyMenu,"Opcion 6","5");     menu_additem(MyMenu,"Opcion 7","6");     menu_additem(MyMenu,"Opcion 8","7");         menu_display(id,MyMenu,0); // Starting in first page... (if you want to use second, change 0 to 2         return PLUGIN_HANDLED; } public MyHandler(id,MyMenu,item) {     if(item == MENU_EXIT)     {         menu_destroy(MyMenu); // Close the menu                 return PLUGIN_HANDLED;     }         new szData[6],iAccess,iCallBack,szOption[32];     menu_item_getinfo(MyMenu,item,iAccess,szData,charsmax(szData),szOption,charsmax(szOption),iCallBack);         new iData = str_to_num(szData);         switch(iData)     {         case 0: client_cmd(id, "say /mejoras");                 case 1: Submenu(id);                 case 2: client_cmd(id, "say /top15");                 // case X: Your number in menu_additem funcion     }         client_print(id,print_chat,"Tocaste el numero: %d de la opcion: %s",iData,szOption);         menu_display(id,MyMenu,2); // Starting in second page... (if you want to use first, change 2 to 0 or 1         return PLUGIN_HANDLED; }   public Submenu(id) {     new menu = menu_create("\yReglas", "HookSubmenu")         menu_additem(menu, "\yReglas Humanos", "1", 0);     menu_additem(menu, "\yReglas Zombies", "2", 0);         menu_setprop(menu, MPROP_EXITNAME, "Salir");     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);         menu_display(id, menu, 0);     return PLUGIN_HANDLED; } public HookSubMenu(id, menu, item) {     if(item == MENU_EXIT)     {         menu_destroy(menu);         return PLUGIN_HANDLED;     }         new data[6], iName[64];     new access, callback;     menu_item_getinfo(menu, item, access, data, 5, iName, 63, callback);         new key = str_to_num(data);         switch(key)     {         case 1:         {             SubMenu3(id);         }         case 2:         {                       AbrirSubMenu(id);         }     }         menu_destroy(menu);     return PLUGIN_HANDLED; }   SubMenu3(id) {     new menu = menu_create("\y Reglas Humanos:", "HookSubMenu3Handler")         menu_additem(menu, "\wNo dispares si no toca tu base.", "1", 0);     menu_additem(menu, "\wSolo base de a \y2.", "2", 0);       menu_additem(menu, "\wPuedes pasar a base de otro si el creador te deja.", "3", 0);       menu_additem(menu, "\wNo agas bases que sean de \yKZ strafe o long-jump.", "4", 0);       menu_additem(menu, "\wNo VALE bloques que disminuyan el movimiento del zombie \y(bases surf).", "5", 0)       menu_additem(menu, "\wNo se permite bloquear respawn zombie o edificar en la zona de regeneracion.", "6", 0)     menu_additem(menu, "\wTambien queda prohibido colocar bloques en zona de respawn ct.", "7", 0)         menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);     menu_display(id, menu, 0); }   public HookSubMenu3Handler(id, menu, item)   {       if (item == MENU_EXIT)       {           menu_destroy(menu)           return PLUGIN_HANDLED       }         new data[6], szName[64];       new access, callback;       menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);           SubMenu3(id)       menu_destroy(menu);       return PLUGIN_HANDLED;   } AbrirSubMenu(id)   {       new menu = menu_create("\yReglas Zombies", "HookAbrirSubMenuHandler")           menu_additem(menu, "\wNo vale hacer \yTOTEM \wpara alcanzar al Humano.", "1", 0)       menu_additem(menu, "\wNo toskees a tus companieros o seras baneado.", "2", 0)       menu_additem(menu, "\wZombies, es obligatorio ir a cualquier base CT.", "3", 0)       menu_additem(menu, "\wSi en un mapa eran zombies y al cambiar vuelven a ser zombies \yNo \wse realizara el cambio.", "4", 0)           menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);     menu_display(id, menu, 0);   }     public HookAbrirSubMenuHandler(id, menu, item)   {       if (item == MENU_EXIT)       {           menu_destroy(menu)           return PLUGIN_HANDLED       }         new data[6], szName[64];       new access, callback;       menu_item_getinfo(menu, item, access, data,charsmax(data), szName,charsmax(szName), callback);           AbrirSubMenu(id)       menu_destroy(menu);       return PLUGIN_HANDLED;   }
wEEk is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-19-2013 , 20:19   Re: [Help] I opened the menu
Reply With Quote #2

My code menu lol

You are from brazil? Send-me a PM
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
wEEk
Senior Member
Join Date: Sep 2012
Old 04-20-2013 , 16:56   Re: [Help] I opened the menu
Reply With Quote #3

Em, Someone could say that is wrong with option 2?

Okay the code, compiles fine but I do not open the option of the rules

@^SmileY; I sent you the PM
wEEk 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 10:53.


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