Quote:
Originally Posted by TrullSin
Could you tell me out here,
Im trying to every time someone with any flag join the server it will make a command, my code is this:
PHP Code:
public OnClientPostAdminCheck(client) { if(IsFakeClient(client)) { return; }
if(CheckCommandAccess(client, "ipanel", ADMFLAG_GENERIC)) { ServerCommand("sm_reloadtags"); ServerCommand("sm_reloadccc"); ServerCommand("sm_rechecktags"); } }
But that will only check for GENERIC, and I was wondering if I could do this:
PHP Code:
public OnClientPostAdminCheck(client) { if(IsFakeClient(client)) { return; }
int flags = ReadFlagString(myflags); if (GetUserFlagBits(client) & flags == flags) { ServerCommand("sm_reloadtags"); ServerCommand("sm_reloadccc"); ServerCommand("sm_rechecktags"); } }
(Do I need to put anything else in the code?)
It is stupid do make this, but sometimes is like if the plugin that I use to make the tags in the server doesent work and I need to recheck the tags, and this is a way to "prevent", everytime a player with any flag joins the server the server will reload the tags and he will get them, maybe there is an easy to way to make that. I was also thinking about an alternative to ServerCommand and like make the command client side even if they dont have perms.
|
CheckCommandAccess works fine.
And with this, you can override admin flags to else later without touching plugin code.
https://sm.alliedmods.net/new-api/co...kCommandAccess
Also, to get admin 'hierarchy' work nicely, don't give adminflag "Z" (root) to anyone. This bypass all things.
Here example, with multiple admin flags.
And this would be 'default' admin flags in plugin code when compile.
PHP Code:
// Admin who have access to all admin flags "abc" or word "ipanel".
if(CheckCommandAccess(client, "ipanel", ADMFLAG_RESERVATION|ADMFLAG_GENERIC|ADMFLAG_KICK))
Ok, you have compiled plugin but you are not satisfied with these admin flags ?
Go
admin_overrides.cfg and override
"ipanel"
Now this
"ipanel" have turn admin flags
"abc" to ->
"ap"
*edit
There is also possibility to restrict access to 'commands' in admin groups. So
admin flags are not only thing in SourceMod.
__________________