Raised This Month: $ Target: $400
 0% 

Make menu from constants


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Paradox.
Member
Join Date: May 2013
Old 01-03-2014 , 06:04   Re: Make menu from constants
Reply With Quote #1

You dind't understood. A menu usually is made using menu_additem(menu,"item","",0)
I want to make the menu to read the items from the constant and the menu items to be the items from constant. Like in Cs Shop https://www.google.ro/url?sa=t&rct=j...58187178,d.bGQ

Last edited by Paradox.; 01-03-2014 at 06:05.
Paradox. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-03-2014 , 06:44   Re: Make menu from constants
Reply With Quote #2

If you know a plugin that already does it, you can look at its code to see how the author did it.

Basically, you loop through all the items in the array and create the menu item based the iteration of the array.

PHP Code:
    for( new 0sizeof(test[]); i++ )
    {
        
menu_additem(menutest[i], ""0);
    } 
__________________
fysiks is offline
Paradox.
Member
Join Date: May 2013
Old 01-03-2014 , 09:43   Re: Make menu from constants
Reply With Quote #3

Quote:
Originally Posted by fysiks View Post
If you know a plugin that already does it, you can look at its code to see how the author did it.

Basically, you loop through all the items in the array and create the menu item based the iteration of the array.

PHP Code:
    for( new 0sizeof(test[]); i++ )
    {
        
menu_additem(menutest[i], ""0);
    } 
I don't understand the code from the plugin .Can you make me a clearly example ? And how can I make an option to be available only from players with ADMIN_LEVEL_H. Like menu_additem(menu,"item",0,ADMIN_LEVEL_H). And how to make the menu handler.

Last edited by Paradox.; 01-03-2014 at 12:14.
Paradox. is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-03-2014 , 16:28   Re: Make menu from constants
Reply With Quote #4

I just gave you an example. Everything else you need to know about that menu system can be found in the "New AMXX Menu System" tutorial.
__________________
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 10:05.


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