Raised This Month: $ Target: $400
 0% 

not open my menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EclipseCP
BANNED
Join Date: Dec 2010
Old 05-14-2011 , 09:50   not open my menu
Reply With Quote #1

hello, sorry for my english, use translator..

i have a problem, not open my menu.

code:

PHP Code:

#define MAX_MODES 5

new const LANG_MODES[MAX_MODES][] =
{
    
"Dog",
    
"Cat",
    
"Parrot",
    
"Crab",
    
"etc"
}

public 
my_menu(id)
{
    new 
menu[128], number[8], menuidi
    
    formatex
(menucharsmax(menu), "\yTest")
    
    
menuid menu_create(menu"my_menu_handle"

    for (
0MAX_MODESi++)
    {    
        
formatex(menucharsmax(menu), "%s"LANG_MODES[i])
        
        
num_to_str(inumcharsmax(num))
        
        
menu_additem(menuidmenunum)
    }
    
    
// No exit
    
menu_setprop(menuidMPROP_EXITMEXIT_NEVER)
    
    
menu_display(idmenuid


public 
my_menu_handle(idmenuiditem)
{
    
// Menu was closed
    
if (item == MENU_EXIT)
    {
        
menu_destroy(menuid)
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
buffer[4], dummyitemid
    menu_item_getinfo
(menuiditemdummybuffercharsmax(buffer), __dummy)
    
    
itemid str_to_num(buffer)
    
    switch(
itemid)
    {
        case 
1client_print(idprint_center"Hello")
    }
    
    
menu_destroy(menuid)
    
    return 
PLUGIN_HANDLED;

EclipseCP is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-14-2011 , 11:05   Re: not open my menu
Reply With Quote #2

Is that the full code ?
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
EclipseCP
BANNED
Join Date: Dec 2010
Old 05-14-2011 , 11:41   Re: not open my menu
Reply With Quote #3

Quote:
Originally Posted by drekes View Post
Is that the full code ?
yes... also already solved

Now I have another problem, I have a callback, but that option becomes disabled :S

PHP Code:
public show_menu_admin_players(id)
{
    new 
menu[128], lang[32], info[32], num[8], buffer[128], menuidi
    
    formatex
(menucharsmax(menu), "\ytest")
    
    
menuid menu_create(menu"menu_admin_convert"

    for (
0sizeof(LANG_MODES); i++) 
    {
        if (
MAX_LIMIT[i] > g_admin_count[id][i]) 
            
formatex(infocharsmax(info), "\r[\w%d\r/\w%d\r]"MAX_LIMIT[i] - g_admin_count[id][i], MAX_LIMIT[i])
        else
            
formatex(infocharsmax(info), "\r[\y0\r/\w%d\r]"MAX_LIMIT[i])
        
        
formatex(menucharsmax(menu), "%s %s"LANG_MODES[i], info)
        
        
num_to_str(inumcharsmax(num))
        
        
buffer[0] = i
        buffer
[1] = 0
        menu_additem
(menuidmenunumADMIN_ALLmenu_makecallback("c_admin_players"))
    }
    
    
// Sin exit
    
menu_setprop(menuidMPROP_EXITMEXIT_NEVER)
    
    
menu_display(idmenuid


Last edited by EclipseCP; 05-14-2011 at 12:05.
EclipseCP is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-14-2011 , 14:47   Re: not open my menu
Reply With Quote #4

Quote:
Originally Posted by drekes View Post
Is that the full code ?
If that's the full code then that's why it doesn't work

Quote:
Originally Posted by EclipseCP View Post
yes... also already solved

Now I have another problem, I have a callback, but that option becomes disabled :S
Show the full code. Also, you should not have menu_makecallback() in the loop. Do it outside of the loop and store the value in a variable and use that variable. I don't think this is the issue here but should be done nonetheless.
__________________
fysiks is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 05-14-2011 , 16:25   Re: not open my menu
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
If that's the full code then that's why it doesn't work
That's why i asked =)
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
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 04:25.


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