Raised This Month: $51 Target: $400
 12% 

Command Group


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mr. Zero
Veteran Member
Join Date: Jun 2009
Location: Denmark
Old 12-26-2010 , 20:14   Command Group
Reply With Quote #1

When registering a new admin command, a command group can be specified as well for that command.

What is this used for? Override access?
Mr. Zero is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 12-26-2010 , 23:18   Re: Command Group
Reply With Quote #2

Quote:
Originally Posted by Mr. Zero View Post
Override access?
Yes.
__________________
asherkin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-27-2010 , 12:26   Re: Command Group
Reply With Quote #3

Can some one make example ?
I can't get it work or I do it wrong.

Quote:
Usage: cmd String containing command to register.
callback A function to use as a callback for when the command is invoked.
adminflags Administrative flags (bitstring) to use for permissions.
description Optional description to use for help.
group String containing the command group to use. If empty, the plugin's filename will be used instead.
flags Optional console flags.
PHP Code:
#include <sourcemod>

public OnPluginStart()
{
    
RegAdminCmd("sm_test"admcmd_testADMFLAG_SLAY"Hii Ho Hoi""group_something"FCVAR_NONE);
}

public 
Action:admcmd_test(clientargs)
{
    
PrintToChat(client"Helou");

    return 
Plugin_Handled;

admins.cfg
Code:
Admins
{
	"Admin"
	{
		"auth"			"steam"
		"identity"		"STEAM_0:1:123456"
		"group"			"group_1"
	}
}
admin_groups.cfg
Code:
	"group_1"
	{
		/**
		 * 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
		{
			":group_something"		"allow"
		}
	}
or I even try this
admin_overrides.cfg
Code:
Overrides
{
	/**
	 * By default, commands are registered with three pieces of information:
	 * 1)Command Name 		(for example, "csdm_enable")
	 * 2)Command Group Name	(for example, "CSDM")
	 * 3)Command Level		(for example, "changemap")
	 *
	 * You can override the default flags assigned to individual commands or command groups in this way.
	 * To override a group, use the "@" character before the name.  Example:
	 * Examples:
	 *		"@CSDM"			"b"				// Override the CSDM group to 'b' flag
	 * 		"csdm_enable"	"bgi"			// Override the csdm_enable command to 'bgi' flags
	 *
	 * Note that for overrides, order is important.  In the above example, csdm_enable overwrites
	 * any setting that csdm_enable previously had.
	 *
	 * You can make a command completely public by using an empty flag string.
	 */
	"@group_something"	""
}
returns everytime [SM] You do not have access to this command.

Last edited by Bacardi; 05-09-2011 at 06:02.
Bacardi is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 05-09-2011 , 06:02   Re: Command Group
Reply With Quote #4

Bump, could somebody show example what works ?
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 05:25.


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