PDA

View Full Version : How to change plugin's flag?


imteme
01-02-2012, 06:54
So Im giving flags "abcjf" to donators on my server.

plugin "SM Super Commands" uses flag "F" (Slay/harm other people) for every command... So every donator gets these super commands.

How can I change the flag to m (Rcon commands). So that donators could NOT use these commands.


Any ways?

Impact123
01-02-2012, 07:26
Command access overrides are one of the most powerful aspects of the SourceMod administration system. They effectively let you:


Change the access to any admin command without modifying plugin source code;

This (http://wiki.alliedmods.net/Overriding_Command_Access_%28SourceMod%29) should work.

Yours sincerely
Impact

Bacardi
01-02-2012, 08:14
Few ways to override commands to admins...

...addons/sourcemod/configs/admin_overrides.cfg
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.
*/

"sm_slap" "m" // Override command sm_slap flag to m
"sm_slay" "mo" // Override command sm_slay, Admin requires all these flag (mo) to use command
}

Using admin group

...addons/sourcemod/configs/admins.cfg

/**
* 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
{
"Baca"
{
"auth" "steam"
"identity" "STEAM_0:1:1"
"group" "Full Admins"
}

"Dude"
{
"auth" "steam"
"identity" "STEAM_0:1:2"
"group" "donators"
}
}



...addons/sourcemod/configs/admin_groups.cfg
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" "abcdefghijklno"

/* Largish number for lots of in-between values. */
"immunity" "99"
}

"donators"
{
Overrides
{
"sm_who" "deny"
"sm_admin" "allow" // can open admin menu
"sm_beacon" "allow"
"sm_slap" "allow"
"sm_say" "allow"
}
"flags" "a"
"immunity" "1"
}
}