Raised This Month: $ Target: $400
 0% 

Making a menu [noob one]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
quark
Veteran Member
Join Date: Oct 2011
Location: Your mind.
Old 12-07-2011 , 02:35   Re: Making a menu [noob one]
Reply With Quote #1

The colors in Menu are /y yellow, /r red and /w white,
^n yes, is new line.
__________________

Check out My Plugins:
qServerInfo ; ASKTAG

Last edited by quark; 12-07-2011 at 02:39.
quark is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-07-2011 , 02:45   Re: Making a menu [noob one]
Reply With Quote #2

^ is the standard escape character in Pawn (or at least for our compiler).


Quote:
Originally Posted by quark View Post
The colors in Menu are /y yellow, /r red and /w white,
^n yes, is new line.
For clarification, you need to use backslashes and not forward slashes.

\R (not the case) is for right alignment (which is approximately in the middle of your screen.
__________________
fysiks is offline
kotinha
Senior Member
Join Date: Jun 2009
Location: Alentejo, Portugal :)
Old 12-07-2011 , 05:33   Re: Making a menu [noob one]
Reply With Quote #3

Emp` has a good tutorial about menus: http://forums.alliedmods.net/showthread.php?t=46364

It explains almost everything
__________________
"If God exists, I hope he has a good excuse." - Woody Allen
kotinha is offline
Misery
Senior Member
Join Date: Dec 2010
Old 12-07-2011 , 12:35   Re: Making a menu [noob one]
Reply With Quote #4

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
Misery is offline
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 #5

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

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

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

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

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