Raised This Month: $ Target: $400
 0% 

adminmenu_custom not cooperating


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HellsCook
Junior Member
Join Date: Dec 2010
Old 12-12-2010 , 22:40   adminmenu_custom not cooperating
Reply With Quote #1

Hi everyone, I've been trying to add some commands to the admin menu and I'm trying to keep it tidy. I've got a lot of stuff to keep track of in there and the easier it is for me to find, the better. I've got the TF2 Balls plugin running on my server and wanted to easily access it's commands. Anyway, while working on the menu, I had everything working until I decided to create an submenu called "Balls" and put the commands under it. They work fine if I take them back out of the submenu, but I really would like to get this working the way I want. Does anyone have any insight as to why this isn't working?

Quote:
// Custom admin menu commands.
// For more information:
//
// http://wiki.alliedmods.net/Custom_Ad...28SourceMod%29
//
// Note: This file must be in Valve KeyValues format (no multiline comments)
//

"Menu"
{
"HD Admin. Commands"
{
"Scramble Teams"
{
"cmd" "sm_Scramblenow"
}
"Scramble Vote Reset"
{
"cmd" "sm_Scramblereset"
}
}
"HD Fun Commands"
{
"Balls"
{
"Birthday Balls"
{
"cmd" "sm_balls_birthday #1"
"execute" "server"
"1"
{
"type" "list"
"title" "Birthday Balls"
"1" "1"
"1." "On"
"2" "0"
"2." "Off"
}
}
"Clear All Balls"
{
"cmd" "sm_balls_cleanup"
}
"Clear Your Balls"
{
"cmd" "sm_cleanballs"
}
"Set Ball Min Size"
{
"cmd" "sm_balls_minsize #1"
"admin" "sm_slay"
"execute" "server"
"1"
{
"type" "list"
"title" "Ball Size"
"1" "0.4"
"1." "40%"
"2" "0.5"
"2." "Default 50%"
"3" "0.6"
"3." "60%"
"4" "0.7"
"4." "70%"
"5" "0.8"
"5." "80%"
"6" "0.9"
"6." "90%"
"7" "1.0"
"7." "Full Size"
}
}
"Spawn Ball"
{
"cmd" "sm_ball"
}
}
}
}
HellsCook is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-13-2010 , 12:12   Re: adminmenu_custom not cooperating
Reply With Quote #2

Have to ask... where you get this "Menu" thing ?
It not going to work that way.
You need add everything between
Code:
"Commands"
{
//Add here categories and commands
}
*edit
I try make it for you... wait a (hours)

Last edited by Bacardi; 12-13-2010 at 12:21.
Bacardi is offline
HellsCook
Junior Member
Join Date: Dec 2010
Old 12-13-2010 , 12:34   Re: adminmenu_custom not cooperating
Reply With Quote #3

The file had "Custom" in it by default I think. I put menu in there in one attempt to get it working. I changed it back after I found it didn't help, in fact, it didn't seem to affect things at all.
HellsCook is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-13-2010 , 13:53   Re: adminmenu_custom not cooperating
Reply With Quote #4

Yea, funny. I tested change default "Commands" to different names and it not have affect...

But anyway, the way you wanted make sub-categories not going to work.
By arrange commands to top of category make easier to use. adminmenu_sorting.txt

Before you try this my custom admin menu, make backup of yours.

Don't know how much rights you have given for those admins...

But try this, (and make backup before doing this)
Make new group in admin_groups.cfg
Code:
Groups
{
    /**
     * Allowed properties for a group:
     *
     *   "flags"           - Flag string.
     *   "immunity"        - Immunity level number, or a group name.
     *                         If the group name is a number, prepend it with an 
     *                         '@' symbol similar to admins_simple.ini.  Users 
     *                         will only inherit the level number if it's higher 
     *                         than their current value.
     */
    "Default"
    {
        "immunity"        "1"
    }
    
    "Full Admins"
    {
        /**
         * You can override commands and command groups here.
         * Specify a command name or group and either "allow" or "deny"
         * Examples:
         *         ":CSDM"            "allow"
         *        "csdm_enable"    "deny"
         */
         Overrides
         {
         }
        "flags"            "abcdefghiz"

        /* Largish number for lots of in-between values. */
        "immunity"        "99"
    }
    
    "HD Admins"
    {
         Overrides
         {
            "sm_admin"        "allow"
            "sm_scramblenow"        "allow"
            "sm_scramblereset"        "allow"
            "sm_balls_cleanup"        "allow"
         }
          "flags"            "o"
    }
}
add admin in this group, admins.cfg (remove person from admin_simple.ini, don't add in both files!)
Code:
/**
 * USE THIS SECTION TO DECLARE DETAILED ADMIN PROPERTIES.
 *
 * Each admin should have its own "Admin" section, followed by a name.
 * The name does not have to be unique.
 *
 * Available properties: (Anything else is filtered as custom)
 *      "auth"          - REQUIRED - Auth method to use.  Built-in methods are:
 *                        "steam"  - Steam based authentication
 *                        "name"   - Name based authentication
 *                        "ip"	- IP based authentication
 *                        Anything else is treated as custom.
 *					 Note: Only one auth method is allowed per entry.
 *
 *      "identity"      - REQUIRED - Identification string, for example, a steamid or name.
 *					 Note: Only one identity is allowed per entry.
 *
 *      "password"      - Optional password to require.
 *      "group"         - Adds one group to the user's group table.
 *      "flags"         - Adds one or more flags to the user's permissions.
 *		"immunity"		- Sets the user's immunity level (0 = no immunity).
 *						  Immunity can be any value.  Admins with higher 
 *						  values cannot be targetted.  See sm_immunity_mode 
 *						  to tweak the rules.  Default value is 0.
 *
 * Example:
	"BAILOPAN"
	{
		"auth"			"steam"
		"identity"		"STEAM_0:1:16"
		"flags"			"abcdef"
	}
 *
 */
Admins
{
	"That admin name"
	{
		"auth"		"steam"
		"identity"	"STEAM_0:1:12345"
		"group"		"HD Admins"
	}
}
- Now that admin can use admin menu with those commands what "allowed"
Rest TF2 Balls commands are hard coded in plugin and behind cvar sm_balls_override "flag"
So I have given now flag "o" to "HD Admins" to example.

You can give also more flags to admin in admin.cfg, just add "flags" parameter.

Do what you like.
Attached Files
File Type: txt adminmenu_sorting.txt (1.0 KB, 191 views)
File Type: txt adminmenu_custom.txt (1.2 KB, 154 views)
Bacardi is offline
HellsCook
Junior Member
Join Date: Dec 2010
Old 12-13-2010 , 17:49   Re: adminmenu_custom not cooperating
Reply With Quote #5

Thanks for your input. As of right now I'm the only admin and it's set through admins.cfg to z. Everything seems to work fine except setting the menu up the way I'd like. I learned some from what you've posted, especially some better practices, but is there just no way to get submenus? I can live without being as organized as I'd like, but it just seems too simple to let go.
HellsCook is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-14-2010 , 03:01   Re: adminmenu_custom not cooperating
Reply With Quote #6

No you can't create sub-menus with SM adminmenu_custom.txt
Admin menu dynamic, start built command parameters after first category.
When final parameter selected it execute ether from admin-player console or from server input.
Bacardi 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 09:17.


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