Raised This Month: $ Target: $400
 0% 

menu_create and outside ids?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sake
Senior Member
Join Date: Jul 2011
Old 10-30-2011 , 04:55   menu_create and outside ids?
Reply With Quote #1

Hello there,

PHP Code:
            new menu,keys;
            
get_user_menu(id,menu,keys);
            
//only show the menu if no other is being displayed
            
if(menu == 0)
            {
                
menu_display(id,g_menu_main,0);
            }
            else
            {
                
//No menu is being displayed
            

The above code works as long as I don't want to check if menu is a menu I created in my plugin. So I was wondering how I could get the outside ID of a menu created via menu_create (new Menu system). In the old system one could use register_menuid for that but whats the pendant for this in the new system?

sake
__________________
sake is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 10-30-2011 , 06:20   Re: menu_create and outside ids?
Reply With Quote #2

Save it in a global variable, like:

Code:
new g_Menu[33] ... public menu(id)      g_Menu[id] = menu_create(...)

Edit: You don't need to create 33 cells and save the menu for everyone, that's just a solution if you want custom menus for every player out there

Code:
new g_Menu ... public menu(id)      g_Menu = menu_create(...)

Last edited by Backstabnoob; 10-30-2011 at 06:21.
Backstabnoob is offline
sake
Senior Member
Join Date: Jul 2011
Old 10-30-2011 , 06:41   Re: menu_create and outside ids?
Reply With Quote #3

I already do that (Look at the variable name).

But the menus are saved internally with ids (0,1,2) and not with the outside ids.

Code:
g_menu_main = menu_create("Weapon Main Menu","mainMenuHandle");
__________________

Last edited by sake; 10-30-2011 at 06:42.
sake is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-30-2011 , 13:02   Re: menu_create and outside ids?
Reply With Quote #4

Explain what you are trying to do.
__________________
fysiks is offline
sake
Senior Member
Join Date: Jul 2011
Old 10-30-2011 , 13:12   Re: menu_create and outside ids?
Reply With Quote #5

I want to check if a player has a menu opened and if yes (and not the menu i want to show him) then I want to tell him he has to use a command for the menu.
__________________
sake is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-30-2011 , 13:14   Re: menu_create and outside ids?
Reply With Quote #6

Then compare the menu id you get from get_user_menu() to the id of the menu that you want and if not equal then they are not looking at your menu.
__________________
fysiks is offline
sake
Senior Member
Join Date: Jul 2011
Old 10-30-2011 , 13:54   Re: menu_create and outside ids?
Reply With Quote #7

-.-

I already know that and told you this. But I can't figure out a way to find the menuids of my menus which are registered via menu_create because menu_create just returns internal ids and no global ones...
__________________

Last edited by sake; 10-30-2011 at 13:54.
sake is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-30-2011 , 14:00   Re: menu_create and outside ids?
Reply With Quote #8

player_menu_info
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
sake
Senior Member
Join Date: Jul 2011
Old 10-30-2011 , 14:34   Re: menu_create and outside ids?
Reply With Quote #9

Which id of the menu does this return? The outside or the inside id?
__________________
sake is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-30-2011 , 19:06   Re: menu_create and outside ids?
Reply With Quote #10

Quote:
Originally Posted by sake View Post
Which id of the menu does this return? The outside or the inside id?
You can easily find that out. Afaik, there is no "local only" reference to menus. There is only global menu identifiers. Emp would need to confirm or deny this.
__________________

Last edited by fysiks; 10-30-2011 at 19:07.
fysiks 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 14:17.


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