Raised This Month: $ Target: $400
 0% 

HELP with menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
risontek22
Member
Join Date: Mar 2013
Location: localhost
Old 07-23-2013 , 03:51   HELP with menu
Reply With Quote #1

hi i have made this, but the menu doesnt show. Help pls

PHP Code:

new const MAPS[][]        = {
    
"de_dust2",
    
"de_dust",
    
"de_aztec",
    
"de_nuke",
    
"de_inferno",
    
"de_italy"
}

public 
cmd_select_map(id)
{
    new 
mmenu menu_create("\rZmenit mapu","cmd_select_map_handler")

    for(new 
i<=  sizeof(MAPS); i++)
    {
        
menu_additem(mmenu,MAPS[i])
    }
    
    
menu_additem(mmenu,"\rZavriet")
    
    
menu_setprop(mmenu,MPROP_PERPAGE,0)
    
menu_setprop(mmenu,MPROP_NUMBER_COLOR,"\y")
    
    
menu_display(id,mmenu)
}

public 
cmd_select_map_handler(id,menu,item)
{
    if(
item == (sizeof(MAPS)+1))
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    if(!
admin[id])
        return 
PLUGIN_HANDLED

    server_cmd
("amx_map %s",MAPS[item])    
        
    return 
PLUGIN_HANDLED

risontek22 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 07-23-2013 , 04:39   Re: HELP with menu
Reply With Quote #2

menu_setprop(mmenu,MPROP_PERPAGE,0)

Take that out

The way you have it your telling the menu to only show 0 items per page.
__________________
Blizzard_87 is offline
risontek22
Member
Join Date: Mar 2013
Location: localhost
Old 07-23-2013 , 05:40   Re: HELP with menu
Reply With Quote #3

Not showing again...

PHP Code:
public cmd_select_map(id)
{
    new 
mmenu menu_create("\rZmenit mapu","cmd_select_map_handler")

    for(new 
i<=  sizeof(MAPS); i++)
    {
        
menu_additem(mmenu,MAPS[i])
    }
    
    
menu_setprop(mmenu,MPROP_NUMBER_COLOR,"\y")
    
    
menu_display(id,mmenu)
}

public 
cmd_select_map_handler(id,menu,item)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    if(!
admin[id])
        return 
PLUGIN_HANDLED

    server_cmd
("amx_map %s",MAPS[item])    
        
    return 
PLUGIN_HANDLED

risontek22 is offline
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 07-23-2013 , 11:25   Re: HELP with menu
Reply With Quote #4

be sure that the admin[id] is true
akcaliberg is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 07-24-2013 , 06:49   Re: HELP with menu
Reply With Quote #5

Code:
for(new i; i <=  sizeof(MAPS); i++)

->

Code:
for( new i = 0; i < sizeof( MAPS ); i++ )
__________________
Blizzard_87 is offline
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 06:22.


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