Raised This Month: $ Target: $400
 0% 

callback to the selected menu item


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EclipseCP
BANNED
Join Date: Dec 2010
Old 04-09-2011 , 02:03   callback to the selected menu item
Reply With Quote #1

hi, sorry for my bad english

a question, how do I make it look all gray (disabled) using callback, an option to select from a menu (again)

PHP Code:
show_menu_admin(id)
{
    new 
menu[128], menuid
    
    
// Title
    
formatex(menucharsmax(menu), "Menu admin" 
    
menuid menu_create(menu"menu_admin")
    
    
formatex(menucharsmax(menu), "test 1")
    
menu_additem(menuidmenu"1")
    
    
formatex(menucharsmax(menu), "test2")
    
menu_additem(menuidmenu"2")
    
    
formatex(menucharsmax(menu), "test3")
    
menu_additem(menuidmenu"3")
    
    
formatex(menucharsmax(menu), "%L"id"BACK")
    
menu_setprop(menuidMPROP_EXITNAMEmenu)
    
    
menu_display(idmenuid)
}

public 
menu_admin(idmenuiditem)
{
    
// Menu was closed
    
if (item == MENU_EXIT)
    {
        
menu_destroy(menuid)
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
buffer[4], dummyitemid
    menu_item_getinfo
(menuiditemdummybuffercharsmax(buffer), __dummy)
    
    
itemid str_to_num(buffer)
    
    switch(
itemid)
    {
        case 
1client_print(idprint_chat"hello1")
        case 
2client_print(idprint_chat"hello2")
        case 
3client_print(idprint_chat"hello3")
    }
    
    
menu_destroy(menuid)
    
    return 
PLUGIN_HANDLED;

grettings!!
EclipseCP is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-09-2011 , 02:55   Re: callback to the selected menu item
Reply With Quote #2

http://forums.alliedmods.net/showpos...0&postcount=95
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-09-2011 , 07:21   Re: callback to the selected menu item
Reply With Quote #3

format the text starting with \d and instead of additem, use addtext.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-09-2011 , 15:37   Re: callback to the selected menu item
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
format the text starting with \d and instead of additem, use addtext.
Just a note: You cannot do that with the first item of a menu because menu_addtext() will not work until there is at least 1 item in the menu.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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 20:07.


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