AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Grey color on New Menu Style. (https://forums.alliedmods.net/showthread.php?t=89850)

xbatista 04-11-2009 06:54

Grey color on New Menu Style.
 
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.?

xPaw 04-11-2009 07:02

Re: Grey color on New Menu Style.
 
\d this is grey

xbatista 04-11-2009 07:04

Re: Grey color on New Menu Style.
 
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

xPaw 04-11-2009 07:22

Re: Grey color on New Menu Style.
 
what?

xbatista 04-11-2009 07:23

Re: Grey color on New Menu Style.
 
Look at the image...
If item not allowed then it would be gray.
If item allowed then it will be color that you want.

Emp` 04-11-2009 07:25

Re: Grey color on New Menu Style.
 
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)

xbatista 04-11-2009 07:28

Re: Grey color on New Menu Style.
 
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?

Emp` 04-11-2009 07:29

Re: Grey color on New Menu Style.
 
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.

xbatista 04-11-2009 07:33

Re: Grey color on New Menu Style.
 
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.

Emp` 04-11-2009 07:35

Re: Grey color on New Menu Style.
 
That looks horrible, but I understand what you mean. Yes that would work.


All times are GMT -4. The time now is 02:21.

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