Raised This Month: $ Target: $400
 0% 

Command in menu only for admin


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-02-2011 , 13:52   Re: Command in menu only for admin
Reply With Quote #11

Quote:
Originally Posted by Napoleon_be View Post
PHP Code:
menu_additem(MyMenu"Menu Admina""4"ADMIN_BAN
"4" stands for item 4.
The "4" is unneeded the way he handles his menu.

PHP Code:
#include <amxmodx>

#define PLUGIN "Menu serwera"
#define VERSION "1.0"
#define AUTHOR "Redux"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /menu","mymenu");
}

public 
mymenu(id)
{
    new 
MyMenu=menu_create("\wMenu serwera [\rDeathrun\w]""cbMyMenu");

    
menu_additem(MyMenu"Zmien serwer"); //item=0
    
menu_additem(MyMenu"Sklep DR"); //item=1
    
menu_additem(MyMenu"Wylacz widocznosc CT"); //item=2
    
menu_additem(MyMenu"Punkty"); //item=3
    
menu_additem(MyMenu"Menu Admina", .paccess=ADMIN_BAN); //item=4
    
menu_additem(MyMenu"Wylacz/wlacz RS"); //item=5

    
menu_setprop(MyMenuMPROP_EXITNAME"Wyjscie") ;
    
menu_setprop(MyMenuMPROP_EXITMEXIT_ALL);
    
menu_setprop(MyMenuMPROP_NUMBER_COLOR"\y");


    
menu_display(idMyMenu,0);
    return 
PLUGIN_HANDLED;
}

public 
cbMyMenu(idmenuitem)
{
    switch(
item)
    {
        case 
0:
        {
            
client_cmd(id"say /serwer");

        }
        case 
1:
        {
            
client_cmd(id"say /drshop");

        }
        case 
2:
        {
            
client_cmd(id"say /invis");

        }
        case 
3:
        {
            
client_cmd(id"say /mypoints");

        }
        case 
4:
        {
            
client_cmd(id"amxmodmenu");

        }
        case 
5:
        {
            
client_cmd(id"say /roundsound");

        }

    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;

P.S. Remove the bind command, it's disrespectful and against the rules here.
__________________
fysiks is offline
kamild1996
Senior Member
Join Date: May 2011
Old 10-02-2011 , 13:54   Re: Command in menu only for admin
Reply With Quote #12

Any topic i found is http://forums.alliedmods.net/showthread.php?t=46364.
I'm so bad in english, that's reason why I want detailed explanation, I hope you understand me.

@fysiks - sorry for that rule break. Your "version" requires any unstandard modules?
kamild1996 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 19:36.


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