Thread: [Solved] remove vip from admins
View Single Post
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 04-08-2021 , 03:10   Re: remove vip from admins
Reply With Quote #9

How I would have change.

Add missing admin override "word" or "command".
https://github.com/SniperOO7/VIP-Pre...2-demo.sp#L460

Code:
stock bool IsClientVIP(int client)
{
	return CheckCommandAccess(client, "sm_vip_only", ADMFLAG_RESERVATION);
}
Compile plugin.
You can change admin access without editing plugin code again.

In admins_override.cfg set "sm_vip_only" set flag to else.
Code:
Overrides
{
	"sm_vip_only" "p"
}

-------------------------------


- Another way to override, set "sm_vip_only" to flag "z" from admin_overrides.cfg
- Do not give admin flag "z" to anyone, not even yourself. Your admin restriction would work then.
- Set admin group and set specific users into that group.
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"
	}

	"vip_group"
	{
		 Overrides
		 {
			"sm_vip_only" "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
Code:
Admins
{
 	"admin1"
	{
		"auth"			"steam"
		"identity"		"XXXXX"
		"flags"			"abcdefghijklmn"
	}

 	"user vip"
	{
		"auth"			"steam"
		"identity"		"xxxx"
		"flags"			"a"
		"group"			"vip_group"
	}
}
Bacardi is offline