Raised This Month: $ Target: $400
 0% 

Grey color on New Menu Style.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-11-2009 , 06:54   Grey color on New Menu Style.
Reply With Quote #1

How to display on New Style Menu this thing :
If you don't have this(something,thing) ,then the text on menu will be GREY .
http://forums.alliedmods.net/showthread.php?t=46364
Give me an example.?
xbatista is offline
Send a message via Skype™ to xbatista
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-11-2009 , 07:02   Re: Grey color on New Menu Style.
Reply With Quote #2

\d this is grey
__________________
xPaw is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-11-2009 , 07:04   Re: Grey color on New Menu Style.
Reply With Quote #3

But if player don't have this(thing or something) , menu will not display items,that what in the menu.


P.S. Look at this(Maybe it's old style menu?) :
http://img118.**************/img118/4306/shoot2ai0.png
xbatista is offline
Send a message via Skype™ to xbatista
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 04-11-2009 , 07:22   Re: Grey color on New Menu Style.
Reply With Quote #4

what?
__________________
xPaw is offline
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-11-2009 , 07:23   Re: Grey color on New Menu Style.
Reply With Quote #5

Look at the image...
If item not allowed then it would be gray.
If item allowed then it will be color that you want.
xbatista is offline
Send a message via Skype™ to xbatista
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-11-2009 , 07:25   Re: Grey color on New Menu Style.
Reply With Quote #6

That is using old style. You can accomplish it with the new menus with callbacks though. (I haven't added anything about them in the tutorial yet)
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`
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-11-2009 , 07:28   Re: Grey color on New Menu Style.
Reply With Quote #7

How about this:
PHP Code:
if ( your_xxx )
{
menu_additem(menu"\rIngram MAC-10""2"0);
}
else
{
menu_additem(menu"\dIngram UZI""2"0);
return 
PLUGIN_HADLED;

Is it good?
xbatista is offline
Send a message via Skype™ to xbatista
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-11-2009 , 07:29   Re: Grey color on New Menu Style.
Reply With Quote #8

That would work, but players will still be able to select it. Something you could do is add an admin flag as the fourth parameter, and then only admins could bypass it when it is disabled.
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`
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 04-11-2009 , 07:33   Re: Grey color on New Menu Style.
Reply With Quote #9

I don't need anythink with admin.
How about this?
PHP Code:
public handle_level_menu(idmenuitem)
{
    if (
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    new 
key str_to_num(data)
if ( 
player_xxx 1)
{
    switch(
key)
    {
case 
1:
        {

}
}
    }

Just example.
xbatista is offline
Send a message via Skype™ to xbatista
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 04-11-2009 , 07:35   Re: Grey color on New Menu Style.
Reply With Quote #10

That looks horrible, but I understand what you mean. Yes that would work.
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`
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 02:21.


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