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

Custom flags using command overrides (for user groups)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nanochip
Senior Member
Join Date: Jan 2014
Old 06-13-2016 , 13:47   Custom flags using command overrides (for user groups)
Reply With Quote #1

I'm trying to accomplish a request I made here:
Quote:
Originally Posted by Nanochip View Post
Spoiler
My ultimate goal here is to implement this into Custom Chat Colors. However, this will be very useful for future permission-based plugins as well.

So, this is what McKay does to check for a flag in order to give that person a "custom chat color" (snipped):
http://pastebin.com/VdTdicqr (using pastebin because for some reason when I try to post this thread, it triggers cloudflare security shit)

And this is my code trying to implement a custom command override rather than a flag (snipped):
http://pastebin.com/fR9QsUfZ

My custom-chatcolors.cfg:
Spoiler

My admin_groups.cfg
Spoiler

My admins.cfg
Spoiler


Since I'm adding the custom override, in admin_groups.cfg under the "Admin" group, shouldn't my CheckCommandAccess return true for me?
Furthermore, I'd like CheckCommandAccess to return false whenever it relies on the default flag (the third argument), however putting -1 didn't seem to accomplish that. Therefore, I put it to ADMFLAG_ROOT since root has access to everything anyways...

I think my issue lies within my lack of knowledge with the CheckCommandAccess function. Or maybe I'm using the wrong function for this situation.

What do I need to know in order to accomplish this? or is this even possible to do?
__________________
Nanochip is offline
Nanochip
Senior Member
Join Date: Jan 2014
Old 06-16-2016 , 14:05   Re: Custom flags using command overrides (for user groups)
Reply With Quote #2

Is what I'm trying to do impractical?
__________________
Nanochip is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 06-16-2016 , 15:05   Re: Custom flags using command overrides (for user groups)
Reply With Quote #3

maybe use it in conjunction with https://sm.alliedmods.net/new-api/ad...ommandOverride ?

But yeah I'm not sure if there's any way to cause CheckCommandAccess to disregard the flags, and always return false if the override/command doesn't exist or the player doesn't have access. Since there are 20 flags, perhaps passing 1<<20 as the default flag would accomplish this? Not sure what bits 20-31 do or if they're even used, or if what I'm saying even makes any sense.

Also, while you're at it, perhaps look into having CCC check that the "group name" specified in custom-chatcolors.cfg matches to a group in admin_groups.cfg.
__________________

Last edited by ddhoward; 06-16-2016 at 15:15.
ddhoward is offline
Nanochip
Senior Member
Join Date: Jan 2014
Old 06-17-2016 , 04:34   Re: Custom flags using command overrides (for user groups)
Reply With Quote #4

Quote:
Originally Posted by ddhoward View Post
Yeah, but then wouldn't I need to specify custom command overrides? Which would defeat the purpose of having custom "flags".

Quote:
Originally Posted by ddhoward View Post
But yeah I'm not sure if there's any way to cause CheckCommandAccess to disregard the flags, and always return false if the override/command doesn't exist or the player doesn't have access. Since there are 20 flags, perhaps passing 1<<20 as the default flag would accomplish this? Not sure what bits 20-31 do or if they're even used, or if what I'm saying even makes any sense.
No idea what you mean here.

Quote:
Originally Posted by ddhoward View Post
Also, while you're at it, perhaps look into having CCC check that the "group name" specified in custom-chatcolors.cfg matches to a group in admin_groups.cfg.
I'll probably just do this instead of attempting to make command overrides into flags.. FindAdmGroup should do the trick.
__________________

Last edited by Nanochip; 06-17-2016 at 04:35.
Nanochip 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 08:51.


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