Raised This Month: $ Target: $400
 0% 

Menus [Admin Only]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 05-15-2014 , 17:23   Re: Menus [Admin Only]
Reply With Quote #3

Quote:
Originally Posted by Flick3rR View Post
Like this maybe?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "x"

#define vip ADMIN_KICK

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /example""ExampleMenu")
}

public 
ExampleMenu(id)
{
    new 
menu menu_create("Example menu:^n""ShopHandled")
    
menu_additem(menu,"Item #1""1")
    
menu_additem(menu,"Item #2""2")
    if(
get_user_flags(id) & vip)
    {
        
menu_additem(menu,"\r[ADMINS]\w Item #\y3""3")
        
menu_additem(menu,"\r[ADMINS]\w Item #\y4""4")        
    }
}

public 
ShopHandler(id)
{
    new 
data[6], iName[64], somethingcallback
    menu_item_getinfo
(menuitemsomethingdata,5iName63callback)
    new 
key str_to_num(data)
    switch(
key)
    {
        case 
1:
        {
            
//Doing something in case of choosen number 1 for all
        
}
        case 
2:
        {
            
//Doing something in case of choosen number 2 for all
        
}
        case 
3:
        {
            
//Doing something in case of choosen number 3 for admins only
        
}
        case 
4:
        {
            
//Doing something in case of choosen number 4 for admins only
        
}
    }
}

//Something like this :D 
That menu won't work. Your not displaying it.

Plus you don't need to send the info parameters. When your not using them.
__________________
Blizzard_87 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 09:38.


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