Raised This Month: $ Target: $400
 0% 

[SOLVED]Menu problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
padilha007
Senior Member
Join Date: Jul 2008
Old 04-06-2009 , 10:18   Re: Menu problem
Reply With Quote #1

PHP Code:
put ^n

menu_additem
(menu"\wNormal""1"0)
    
menu_additem(menu"\wMedium""2"0)
    
menu_additem(menu"\whigh""3"0)
    
menu_additem(menu"\whelp^n""4"0)
    
menu_additem(menu"\wExit""5"MEXIT_ALL
__________________


Last edited by padilha007; 04-06-2009 at 10:21.
padilha007 is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-06-2009 , 10:19   Re: Menu problem
Reply With Quote #2

Quote:
Originally Posted by padilha007 View Post
put ^n

menu_additem(menu, "\wNormal", "1", 0)
menu_additem(menu, "\wMedium", "2", 0)
menu_additem(menu, "\whigh", "3", 0)
menu_additem(menu, "\whelp^n", "4", 0)
menu_additem(menu, "\wExit", "5", MEXIT_ALL)
Yop. ty
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 04-06-2009 , 11:49   Re: Menu problem
Reply With Quote #3

Quote:
Originally Posted by padilha007 View Post
PHP Code:
put ^n

menu_additem
(menu"\wNormal""1"0)
    
menu_additem(menu"\wMedium""2"0)
    
menu_additem(menu"\whigh""3"0)
    
menu_additem(menu"\whelp^n""4"0)
    
menu_additem(menu"\wExit""5"MEXIT_ALL
This won't hide the 4., to hide it, you need to use the old menu system.

PHP Code:
new szMenu[150];

format(szMenu149"LOL MENU!^n^n1. Normal^n2. Medium^n3. High^n^n5. Help^n^n^n9. Exit 
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-06-2009 , 11:57   Re: Menu problem
Reply With Quote #4

damn. :-( ok ill use old system. & whats with the case 1? know anyone why this not works?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 04-06-2009 , 12:43   Re: Menu problem
Reply With Quote #5

Quote:
Originally Posted by Dores View Post
This won't hide the 4., to hide it, you need to use the old menu system.
But it doesn't matter if this is okay:
Quote:
1. hi
2. bye
3. anything

4. lol
?

5.
exit
Just depends is it.
SnoW is offline
Send a message via MSN to SnoW
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-06-2009 , 14:29   Re: Menu problem
Reply With Quote #6

Use this to add a blank line to the "new menu" system.

PHP Code:
/**
 * Adds a blank line to a menu.
 *
 * @param menu            Menu resource identifier.
 * @param slot            1 (default) if the line should shift the numbering down.
 *                         0 if the line should be a visual shift only.
 * @noreturn
 * @error                Invalid menu resource.
 */
native menu_addblank(menuslot=1); 
PHP Code:
    new menu menu_create("Menu Title:""menu_handler")
    
menu_additem(menu"hi""1"0)
    
menu_additem(menu"bye""2"0)
    
menu_additem(menu"anything""3"0)
    
menu_addblank(menu)
    
menu_additem(menu"lol?""5"0)
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
menu_display(idmenu0
__________________

Last edited by fysiks; 04-06-2009 at 14:39.
fysiks is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-06-2009 , 14:45   Re: Menu problem
Reply With Quote #7

TY, TY! & how to menu in menu ?


PHP Code:
register_clcmd"CM_Menu_hi","Level_menu2")


menu_additem(menu"\whi""3"0)


 case 
3:
        { 
            
client_cmd(id"CM_Menu_hi")
            
//return PLUGIN_HANDLED
        

is there a better way?
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 04-06-2009 , 15:04   Re: Menu problem
Reply With Quote #8

PHP Code:
DisplayMenu1(id)
{
    
// ... Make Menu 1
}
HandleMenu1(idmenuitem)
{
    switch(
key)
    {
        case 
#:
        
{
            
menu_destroy(menu)
            
DisplayMenu2(id)
        }
        
// ...
    
}
}
DisplayMenu2(id)
{
    
// ... Make Menu 2
}
HandleMenu2(idmenuitem)
{
    
// ... Handle Menu 2 with option ("Back") to open menu 1
    
switch(key)
    {
        case 
#:
        
{
            
menu_destroy(menu)
            
DisplayMenu1(id)
        }
        
// ...
    
}

You could even use one handler if you want, send data "##" (first number is your menu number and second number is item number). Then you could use a single switch or a nested switch if you break apart the digits (first switch for menu number and nested switch for item number). I don't know if any of this is efficient but It may be worth a try.
__________________

Last edited by fysiks; 04-06-2009 at 15:12.
fysiks is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-06-2009 , 15:08   Re: Menu problem
Reply With Quote #9

hihi. Ty.

now the biggest problem.

code in case 1 has no effect but i tested the code & this works fine alone.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
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 02:23.


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