Raised This Month: $ Target: $400
 0% 

menu_create and outside ids?


Post New Thread Reply   
 
Thread Tools Display Modes
sake
Senior Member
Join Date: Jul 2011
Old 10-31-2011 , 03:43   Re: menu_create and outside ids?
Reply With Quote #11

Hmmm. Okay.

But why does it return 0,1,2 for the 3 menus in my plugin that were created via menu_create?

I do it like this:

Code:
menu = menu_create(...); //returns 0 for the first menu created in the plugin, 1 for the second,...

But when i do get_user_menu(...) I get the outside id.

What am I doing wrong?
__________________
sake is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-31-2011 , 16:48   Re: menu_create and outside ids?
Reply With Quote #12

player_menu_info should return the new menu id (created with menu_create) in the newmenu argument by reference (see link above to funcwiki for player_menu_info).

IIRC get_user_menu was created before the new menus, so it would not make sense that it has support for the new menus (unless it was updated).

As for the difference between menu ids, you have to think of them as two different things. The randomly created menus for the game and old menus have an index assigned to them; for the new menus they are also assigned an index for the menu, but you never interact with it because it is within the AMXX code.

The new menus (menu_create) return an internal menu index for which menu it is within the AMXX code for generating these menus. The two indices are used for two separate things.
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 11-01-2011 , 07:15   Re: menu_create and outside ids?
Reply With Quote #13

Thanks Emp`.
__________________
sake 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:43.


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