It makes me notice I made a mistake in my example (Access_Reservation doesn't mean anything...)
Anyway,
Let's say I'll give up with this and only use CheckCommandAccess.
Quote:
Originally Posted by TnTSCS
Something like this - just one way to skin this cat... you can get pretty creative with the overrides and what not.
PHP Code:
bool:IsPlayerGenericAdmin(client) { if (CheckCommandAccess(client, "generic_admin", ADMFLAG_GENERIC, false)) { return true; }
return false; }
|
Need to be sure: instead of "generic_admin", I should have a command right?
(part removed)
Lately I tried to use it this way and it seems to work fine:
Code:
public OnClientPostAdminCheck(client)
{
if (CheckCommandAccess(client, "sm_map", ADMFLAG_CHANGEMAP, true))
{
g_bPlayerIsAdmin[client] = true;
}
}
I'm a bit confused when I read this:
Quote:
If true, SourceMod will not attempt to find a matching command, and it will only use the default flags specified. Otherwise, SourceMod will ignore the default flags if there is a matching admin command.
Notes: Returns whether a client has access to a given command string. The string can be any override string, as overrides can be independent of commands. This feature essentially allows you to create custom flags using the override system.
Return: True if the client has access, false otherwise.
Version Added:1.0.0.1946
"CheckCommandAccess looks through all overrides for a match, then all admin commands, and then finally the passed in flags". "override_only skips the commands, as it's very slow, only looking at overrides (and the fallback flags)"
|
Wait:
The string can be any override string, as overrides can be independent of commands.
So
"generic_admin", even if it's not a command, can work?
Thx
St00ne
PS: Anyway I'm starting to try all situations (editing this part, compiling and testing) since the rest of my plugin is ready.
Don't get mad at helping me here...
__________________