Raised This Month: $ Target: $400
 0% 

Enum bits for menu options


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
skatz_ws
Junior Member
Join Date: Aug 2019
Old 09-08-2019 , 10:42   Re: Enum bits for menu options
Reply With Quote #3

Right, made it!
Now I want to create a const to give "names" to that option in the menu, is this the right way?

PHP Code:
new const MenuOptions[][Options] = 
{
    
"Option 1",
    
"Option 2",
    
"Option 3"
}; 
And in the menu, something like:

PHP Code:
static item[128];
for(new 
0sizeof Optionsi++)
{
    
formatex(itemsizeof(item) - 1"%s%s"MenuOptions[i], Options:(1<<i) ? "\yON" "\rOFF");
    
menu_additem(menuitem"");

I think that's incorrect because I dont know much about bits and how to work with that enumeration but its just to explain what I want to make

Last edited by skatz_ws; 09-08-2019 at 10:46.
skatz_ws is offline
 



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 17:29.


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