Raised This Month: $32 Target: $400
 8% 

Adding additional custom flags to Sourcemod


Post New Thread Reply   
 
Thread Tools Display Modes
.BadGurl AKA FallenAngel
Member
Join Date: Jun 2011
Location: UK
Old 07-05-2012 , 04:11   Re: Adding additional custom flags to Sourcemod
Reply With Quote #11

Just use the admin overrides file to make commands for custom flags, I use one to make skins available to public players by using the 'p' flag and then just assign the flag to the player (or group) on sourcebans.

Your admin overrides text file would look like this..


Quote:
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_admins" "b,z" //Only admins & owners to view online admins
"om_admin_credits" "z" //Owners only
"sm_god" "z" //godmode
"sm_noclip" "z" //noclip
"sm_models" "b,p" //skins
}
__________________

Last edited by .BadGurl AKA FallenAngel; 07-05-2012 at 04:14.
.BadGurl AKA FallenAngel is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 07-05-2012 , 07:03   Re: Adding additional custom flags to Sourcemod
Reply With Quote #12

Perhaps it's suitable for commands, but some plugins also have actions or events and need to implement their own set of permissions.

Plugins could just use custom flags to control permissions to specific features, but that may conflict with the same flag in other plugins where you want access to one feature in one plugin, but not in another plugin.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 07-05-2012 at 07:05.
rhelgeby is offline
Send a message via MSN to rhelgeby
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-05-2012 , 07:04   Re: Adding additional custom flags to Sourcemod
Reply With Quote #13

Quote:
Originally Posted by rhelgeby View Post
Perhaps it's suitable for commands, but some plugins also have actions or events and need to implement their own set of permissions.
Which should be mapped to a string that can be used with both regular and admin group overrides (which allow both a flag as in regular overrides, along with specific "allow" or "deny" access) with CheckCommandAccess.
__________________

Last edited by asherkin; 07-05-2012 at 07:05.
asherkin is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 07-05-2012 , 07:11   Re: Adding additional custom flags to Sourcemod
Reply With Quote #14

So we could just make fake command strings like "myPlugin.myFeature" and override those instead? Though they would still need to be mapped to flags. In some cases it would be enough to just be a member of a group.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-05-2012 , 07:17   Re: Adding additional custom flags to Sourcemod
Reply With Quote #15

Quote:
Originally Posted by rhelgeby View Post
So we could just make fake command strings like "myPlugin.myFeature" and override those instead? Though they would still need to be mapped to flags. In some cases it would be enough to just be a member of a group.
Yes, although I'd advise using all lowercase and underscores to fit in with everything else (although then they might be confused with commands).

As for default flag mapping, it's just a matter of making sane choices (if it's a public plugin, else just go wild as you know how you'll be setting up overrides).

Some simple default recommendations (for things that don't have a sane equivalent flag of their own):
Public: 0
Any admin: Generic
No-one: Root

One silly thing some people do that could screw this up: Give other people the Root flag.
It's basically designed as a complete override to the admin system, for the server console.
__________________
asherkin is offline
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 07-05-2012 , 11:22   Re: Adding additional custom flags to Sourcemod
Reply With Quote #16

Quote:
Originally Posted by asherkin View Post
One silly thing some people do that could screw this up: Give other people the Root flag.
It's basically designed as a complete override to the admin system, for the server console.
It amazes me when people post here saying that they give all their admins root because they don't want to set up permissions then they ask how to prevent admins from doing x or y.
__________________
Dr. McKay is offline
Smarmy
Senior Member
Join Date: Mar 2012
Old 07-07-2012 , 15:56   Re: Adding additional custom flags to Sourcemod
Reply With Quote #17

Quote:
Originally Posted by Dr. McKay View Post
It amazes me when people post here saying that they give all their admins root because they don't want to set up permissions then they ask how to prevent admins from doing x or y.
It's like the process of elimination, done admin permissions style.

Give everyone all permissions and then find out who will abuse what and only remove those permissions from said abusive admins.
Smarmy 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 19:29.


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