Raised This Month: $ Target: $400
 0% 

Old menu problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 01-15-2011 , 11:26   Old menu problem
Reply With Quote #1

Hey, why the hell when I open menu number 1 (Keysrod1 ...), and I press any key, it opens the Pressedrod of menu number 0...

Here is my code:

PHP Code:
#define Keysrod (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9)
#define Keysrod1 (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)|(1<<6)|(1<<7)|(1<<8)|(1<<9) 
PHP Code:
    register_menucmd(register_menuid("rod"), Keysrod"Pressedrod");
    
register_menucmd(register_menuid("rod1"), Keysrod1"Pressedrod1"); 
PHP Code:
public Showrod(id){
    
show_menu(idKeysrod"\wColor explanation:^n\y'n*' - normal color text ( depends on con_color )^n't*' - team color text ( depends on team )^n'g*' - green text color^n\wWelcome message example: g*Hello t*boys n*and t*girls", -1"rod");
}
public 
Pressedrod(idkey) {
    switch (
key) {
        default: 
        {
            
client_cmd(id"speak sound/confirmed0" );
            
WelmsgMenu(id);
        }
    }

PHP Code:
public Showrod1(id){
    new list[
256];
    new 
vipnames[33][33];
    new 
count;
    new 
x;
    new 
msg[256], iLen;
    
    for(
1<= 33x++){
    if(
is_user_connected(x))
        if(
iVip[id] == 1)
        
get_user_name(xvipnames[count++], 32);
    }
    
    if(
count == 0)
    {
    
formatex(list, 255"\yNo admins online");
    }
    else
    {
    for(new 
count i++) {
    
iLen += format(msg[iLen], 255-iLen"\w%s^n"vipnames[i]);
    }
    
formatex(list, 255"\wAdmins online \y[ \w%d\y ]\w:^n%s"countmsg);
    
show_menu(idKeysrod1, list, -1"rod1");
    }
}
public 
Pressedrod1(idkey) {
    switch (
key) {
        default: 
        {
        
        }
    }
    return 
PLUGIN_CONTINUE;

When I open the menu with admin list, then press any key the pressed key affects to pressedrod menu ... and it opens me WelmsgMenu...
reinert is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-15-2011 , 12:12   Re: Old menu problem
Reply With Quote #2

I don't understand what you are asking, you may have a look at plugins such as playermenu of telemenu, such menus are used.

It seems that you don't take key in account in callback, you have only default switch case.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 01-15-2011 , 12:41   Re: Old menu problem
Reply With Quote #3

You registered menu in a wrong way. Try this:
PHP Code:
    register_menucmd(register_menuid("\wColor exp"), Keysrod"Pressedrod");
    
register_menucmd(register_menuid("\wAdmins online"), Keysrod1"Pressedrod1"); 
__________________
Impossible is Nothing
Sylwester is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-15-2011 , 12:42   Re: Old menu problem
Reply With Quote #4

I hadn't see this, also you don't need to put \w in the register line, just a part of the begining of menu string.
For such a menu, why don't you use new menu system ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-15-2011 , 13:12   Re: Old menu problem
Reply With Quote #5

Because I don't know how to make a list with new menu :/

Also, when I make a new style menu only with title, the menu doesn't even show up :/

Last edited by reinert; 01-15-2011 at 13:30.
reinert is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 01-15-2011 , 15:18   Re: Old menu problem
Reply With Quote #6

Quote:
Originally Posted by reinert View Post
Because I don't know how to make a list with new menu :/

Also, when I make a new style menu only with title, the menu doesn't even show up :/
You obviously don't know how to use the OLD menu style either, and the old menu style is much more complicated.
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-15-2011 , 15:42   Re: Old menu problem
Reply With Quote #7

yeah, I prefer to use new, but new menu doesn't work without any items in menu and menu_addtext doesn't help :s
reinert is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-15-2011 , 15:51   Re: Old menu problem
Reply With Quote #8

Why do you want an item if no admin is online ?
Also, if no admin are online, why don't add an item with some admin access so player will only see the text and won't be able to select that item ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Len
Senior Member
Join Date: Dec 2007
Old 01-15-2011 , 15:56   Re: Old menu problem
Reply With Quote #9

why are you telling what to do with the plugin he wants to make, he just wants help with the menu
__________________


Connect to server

IP: 81.19.210.28:27015
Len is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 01-15-2011 , 16:17   Re: Old menu problem
Reply With Quote #10

Quote:
Originally Posted by Len View Post
why are you telling what to do with the plugin he wants to make, he just wants help with the menu
Why don't you help him ?
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 01:55.


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