Raised This Month: $ Target: $400
 0% 

Help with Menu


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
didoWEE
Senior Member
Join Date: Oct 2012
Location: Bulgaria
Old 04-15-2013 , 15:15   Re: Help with Menu
Reply With Quote #3

Quote:
Originally Posted by Balck View Post
PHP Code:
    register_menucmd(register_menuid("MATRICA VIP Main Menu"), 1023"setmenu"
PHP Code:
public vipmainmenu(id)
{
    new 
menu[192
    new 
keys MENU_KEY_0|MENU_KEY_1|MENU_KEY_2 
    format
(menu191"MATRICA VIP Main Menu^n^n1. What you want^n2. What you want^n^n0. Exit"
    
show_menu(idkeysmenu)      
    return 
PLUGIN_CONTINUE
}

public 
setmenu(idkeymenu)
{
    if(
key == 0) {
         
Your comand :S what you want
         
return PLUGIN_HANDLED
    
}

    if(
key == 1) {
         
Your comand :S what you want
         
return PLUGIN_HANDLED
    
}

    else {
         return 
PLUGIN_HANDLED
    
}

    return 
PLUGIN_HANDLED

Don't use the old style and see this: http://forums.alliedmods.net/showthread.php?t=46364

Padarok
PHP Code:
public vipmainmenu(id)
{
    if(
is_user_vip(id))
    {
        new 
menu menu_create("\yMATRICA VIP Main Menu""vipmainmenu_handler");
        
        
menu_additem(menu"\yVIP Items""1"0);
        
menu_additem(menu"\yVIP AP/XP Menu""2"0);
        
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu0);
    }
    
// else client_print(id, print_chat, "You have to be V.I.P. to open this menu");
}

public 
vipmainmenu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
// do sth
        
}
        case 
2:
        {
            
// do sth
        
}
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;


Last edited by didoWEE; 04-15-2013 at 15:16.
didoWEE 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 10:57.


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