Raised This Month: $ Target: $400
 0% 

[SOLVED]Menu problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-06-2009 , 09:40   [SOLVED]Menu problem
Reply With Quote #1

Hi.

first : how can i add a space between menu options? like :
PHP Code:
1. hi
2. bye
3. anything

5. lol
?

9. exit 
2. how can i have a menu in menu?

PHP Code:
1.lol menu
2. haha menu

9. 
exit

>> 
by 1 :

ur now in lol menu

1. bluh
2.bluh

9. back 
3. i added a menu to my code but when i choose 1, happend nothing.
i just become the say but the code in case 1 has no effect :

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <fakemeta>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta_const>


#define PLUGIN "Creazy Mazy"
#define VERSION "1.0"
#define AUTHOR "One"

#define TASK_MENU_DISLPAY_TIME 3.0

new bool:moving[512] = true
new const gMovementlevel1[8][1024] =     // Dont change 1024!!
{
    
"+back;wait;wait;wait;wait-back",
    
"+moveleft;wait;wait;wait;wait;-moveleft",
    
"+moveright;wait;wait;wait;wait;-moveright",
    
"+forward;wait;wait;wait;wait;-forward",
    
"-forward",
    
"-back",
    
"-moveleft",
    
"-moveright"
};
new const 
gMousecmds[6][1024] =
{
    
"+lookdown;wait;+right;wait;-right;-lookdown",
    
"+lookup;wait;+left;wait;-lookup;wait;+lookdown;wait;wait;-left;wait;-lookdown",
    
"-lookup",
    
"-lookdown",
    
"-left",
    
"-right"
}
public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd"CM_Menu","Level_menu")
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);
    
register_forwardFM_PlayerPreThink"client_prethink" )
}
public 
Level_menu(id)
{
    new 
menu menu_create("\rChoose you´r Level!:""menu_handler")
    
menu_additem(menu"\wNormal""1"0)
    
menu_additem(menu"\wMedium""2"0)
    
menu_additem(menu"\whigh""3"0)
    
menu_additem(menu"\whelp""4"0)
    
menu_additem(menu"\wExit""5"MEXIT_ALL)
    
//menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
    
menu_display(idmenu0)
 }
 public 
fwHamPlayerSpawnPost(id)
{
    
set_task(TASK_MENU_DISLPAY_TIME"Level_menu"id);
    return 
HAM_IGNORED;
}
public 
menu_handler(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        
//return PLUGIN_HANDLED
    
}
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    new 
key str_to_num(data)
    switch(
key)
    {
        case 
1:
        {
            if (
moving[id]) return PLUGIN_HANDLED;
            new 
button pev(id,pev_button)
    
            if (
button == IN_FORWARD)
            {
                
client_cmd(id,"%s"gMovementlevel1random_num1charsmaxgMovementlevel1 ) ) ]);
            }
            if (
button == IN_BACK)
            {
                
client_cmd(id,"%s"gMovementlevel1random_num1charsmaxgMovementlevel1 ) ) ]);
            }
            if (
button == IN_MOVELEFT)
            {
                
client_cmd(id,"%s"gMovementlevel1random_num1charsmaxgMovementlevel1 ) ) ]);
            }
            if (
button == IN_MOVERIGHT)
            {
                
client_cmd(id,"%s"gMovementlevel1random_num1charsmaxgMovementlevel1 ) ) ]);
            }
            if ( 
button == IN_RIGHT)
            {
                
client_cmd(id"%s"gMousecmdsrandom_num1charsmaxgMousecmds ) ) ]);
            }
            if ( 
button == IN_LEFT)
            {
                
client_cmd(id"%s"gMousecmdsrandom_num1charsmaxgMousecmds ) ) ]);
            }
        
            
moving[id] = true;
            
set_task(0.4,"reset",id,"",0,"ab"1)  // Never change this. if change = Channel flood!
            //set_task(0.4,"reset",id,"",0,"ab", 1) 
            
client_print(idprint_chat"Ok level 1")
            
menu_destroy(menu)
            
//return PLUGIN_HANDLED;
        
}
        case 
2:
        {
            
client_print(idprint_chat"22222222")
        }
        case 
3:
        { 
            
client_print(idprint_chat"333333!")
            
menu_destroy(menu)
            
//return PLUGIN_HANDLED
        
}
    }
    
menu_destroy(menu)
    
//return PLUGIN_HANDLED
}
public 
reset(id)
{
    
moving[id] = false;

__________________

Last edited by One; 04-07-2009 at 10:21.
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 , 09:57   Re: Menu problem
Reply With Quote #2

For the first one you should use the old menu system, unless you don't mind something like this:

Code:
1. kadjf
2. kajv
3. kdafvnm
4.
5. fadlsam
...
Which can be done(maybe) by using menu_additem(menu, "").
__________________
O o
/¯________________________
| IMMA FIRIN' MAH LAZOR!!!
\_¯¯¯
Dores is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 04-06-2009 , 09:59   Re: Menu problem
Reply With Quote #3

Quote:
Originally Posted by Dores View Post
For the first one you should use the old menu system, unless you don't mind something like this:

Code:
1. kadjf
2. kajv
3. kdafvnm
4.
5. fadlsam
...
Which can be done(maybe) by using menu_additem(menu, "").
ty, but is this poss to hide this 4. ?
__________________
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
padilha007
Senior Member
Join Date: Jul 2008
Old 04-06-2009 , 10:18   Re: Menu problem
Reply With Quote #4

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 #5

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 #6

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 #7

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 #8

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 #9

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 #10

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
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