Raised This Month: $ Target: $400
 0% 

custom menu


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 12-17-2007 , 08:16   custom menu
Reply With Quote #1

Hello, i wanted to make a custom menu for admin on my server so they only see where they have the acces for but i have 2 things i cant get work and ask therefore for some help here.

The thing i have already is this

Code:
#include <amxmodx> 
#include <cstrike> 

#define Keysadmin_menu (1<<0)|(1<<1)|(1<<9)

public plugin_init() { 
    register_plugin("Admin Menu","1.0","sharpe") 

    register_clcmd( "adminmenu","Showadmin_menu", ADMIN_LEVEL_A, "Open menu") 

    register_menucmd(register_menuid("admin_menu"), Keysadmin_menu, "Pressedadmin_menu") 
} 

public Showadmin_menu(id) { 
    show_menu(id, Keysadmin_menu, "\yAdmin Menu^n^n\w1. action1^n2. action2^n3. action3^n^n0. Exit^n", -1, "admin_menu")
} 

public Pressedadmin_menu(id, key) { 

    switch (key) { 
        case 0: client_cmd(id,"amx_banmenu") 
        case 1: client_cmd(id,"amx_recordmenu")      
    } 
    return PLUGIN_HANDLED 
}
The 2 problems i have is that every player can open the menu even if they dont have the admin_level_a acces and in the console i getthe message unknown command: adminmenu althought the menu is just working. Have anyone an idea how to fix both problems?
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 12-17-2007 , 09:09   Re: custom menu
Reply With Quote #2

Code:
public Showadmin_menu(id, level, cid) {   if ( ! cmd_access(id, level, cid, 0) )     return PLUGIN_CONTINUE     show_menu(id, Keysadmin_menu, "\yAdmin Menu^n^n\w1. action1^n2. action2^n3. action3^n^n0. Exit^n", -1, "admin_menu") }
[ --<-@ ] Black Rose is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-17-2007 , 09:59   Re: custom menu
Reply With Quote #3

PHP Code:
public Showadmin_menu(idlevelcid) {
    if (!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED

    show_menu
(idKeysadmin_menu"\yAdmin Menu^n^n\w1. action1^n2. action2^n3. action3^n^n0. Exit^n", -1"admin_menu")

    return 
PLUGIN_HANDLED // this fix the unknown cmd message

You need to include amxmisc.inc
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 12-17-2007 at 10:02.
ConnorMcLeod is offline
Maurice
Senior Member
Join Date: Nov 2006
Location: Netherlands
Old 12-17-2007 , 10:35   Re: custom menu
Reply With Quote #4

Thanks both! Althought only connorr's update seems to work.
__________________
Luck? Luck is only one feeling of amazement concerning a seemingly incidental circumstance which one himself must create.
Maurice is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-17-2007 , 10:44   Re: custom menu
Reply With Quote #5

Yeah, change a 1 in a 0 and all is messed up
__________________
- tired and retired -

- my plugins -
ConnorMcLeod 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 11:08.


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