Hello all, I got a little problem, hope someone can help me,
I m using medic shield plugins https://forums.alliedmods.net/showthread.php?p=2138254
but this plugins's command sm_shield granted all player access right now, how to deny it except admins.cfg 's player?
public OnPluginStart()
{
CreateConVar("sm_medicshield_version", PLUGIN_VERSION, "Donator Building Colors Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
RegAdminCmd("sm_shield", Command_Shield, ADMFLAG_RESERVATION, "Turns on the Medic's shield effect from MvM. Usage: sm_shield");
RegAdminCmd("sm_shield2", Command_Shield2, ADMFLAG_RESERVATION, "Turns on the Medic's advanced shield effect from MvM. Usage: sm_shield2");
}
(will only work for admins with ban command access)
You know, you can now override regular SM RegConsoleCmd to use admin flags, in version 1.5.x
Just in admin_overrides.cfg
PHP 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.
*/
"sm_shield" "b" // Overrides to flag b
"sm_shield2" "bc" // Overrides to adminflag b and c
}
and if you want only, one of admin group to use it
Spoiler
admin_overrides.cfg
PHP 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.
*/
"sm_shield" "z"
"sm_shield2" "z"
}
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"
Overrides
{
"sm_shield" "allow"
"sm_shield2" "allow"
}
}
"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"
}
}
admins.cfg
PHP 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"
}