Raised This Month: $ Target: $400
 0% 

Making a menu [noob one]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-07-2011 , 20:32   Re: Making a menu [noob one]
Reply With Quote #1

Quote:
Originally Posted by Misery View Post
Thanks alot guys, those thing were not obvious to me!

Also, could some1 explain me this line
Code:
register_menucmd( register_menuid("\yOptions:"), 1023, "menu_cmd" )
1-What does the register_menuid() do? Does it generate a unique id based on the menu's title?
2-Also, is "menu_cmd" the function which shows the menu?

Thanks!

Misery
1. I've never quite understood the purpose because the result of that function is never used IIRC. The string you use there is what you use in show_menu() to uniquely identify the menu.

2. menu_cmd is the function that is called when an option is chosen for the menu corresponding to the register_menuid(...). Look at how other plugins use that menu system.

But, remember that that code you posted is an entirely different menu system than the one posted above (the thread by Emp'). Unless you have a specific reason for the menu style you posted above I would recommend the one in the link.
__________________

Last edited by fysiks; 12-07-2011 at 20:33.
fysiks is offline
Misery
Senior Member
Join Date: Dec 2010
Old 12-08-2011 , 13:47   Re: Making a menu [noob one]
Reply With Quote #2

So basically...
register_menuid() is useless?
Let's sayd I had two menus with the same string... it will generate the same menuid for the twos? Not very secure?

Last edited by Misery; 12-08-2011 at 13:48.
Misery is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-08-2011 , 16:15   Re: Making a menu [noob one]
Reply With Quote #3

Quote:
Originally Posted by Misery View Post
So basically...
register_menuid() is useless?
Let's sayd I had two menus with the same string... it will generate the same menuid for the twos? Not very secure?
It's not useless, maybe poorly implemented. You would think it would work like pointers but it doesn't. Don't expect it to change as the development is basically dead for AMX Mod X.
__________________
fysiks is offline
Misery
Senior Member
Join Date: Dec 2010
Old 12-09-2011 , 21:01   Re: Making a menu [noob one]
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
1. I've never quite understood the purpose because the result of that function is never used IIRC. The string you use there is what you use in show_menu() to uniquely identify the menu.
Is there any other method to achieve the same result?
Because frankly, register_menuid() is a piece of shit.

Last edited by Misery; 12-09-2011 at 21:02.
Misery is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-09-2011 , 23:20   Re: Making a menu [noob one]
Reply With Quote #5

Quote:
Originally Posted by Misery View Post
Is there any other method to achieve the same result?
Because frankly, register_menuid() is a piece of shit.
Did you happen to read Post #4? Doesn't seem like it.
__________________
fysiks is offline
Misery
Senior Member
Join Date: Dec 2010
Old 12-10-2011 , 01:04   Re: Making a menu [noob one]
Reply With Quote #6

Yes. I read it. However, I'll be using the old menus.
Mostly because I need dynamical options, and the new menu system is poor for that kind of style...

I assume theres no other alternative to register_menuid()... sad :[

Last edited by Misery; 12-10-2011 at 01:05.
Misery is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-10-2011 , 01:08   Re: Making a menu [noob one]
Reply With Quote #7

What exactly do you mean by dynamic options? Be specific.
__________________
fysiks 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 11:56.


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