Request/Idea:
Can you create a feature so that the custom chat colors can be applied to groups that have a specified command override, rather than using the flags? So you'd put the "command_override" key instead of the "flag" key, and a custom override would be the value, and that override would go in the admin_groups file.
For example:
Code:
"admin_colors"
{
"Admin"
{
"command_override" "customchatcolors_admin" //Instead of "flag" key, this is where you'd put a custom command override
"tag" "[Admin] "
"tagcolor" "#4294FF"
}
}
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
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?
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.
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
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
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.