Raised This Month: $7 Target: $400
 1% 

[Solved] ROOT / ADMFLAG_GENERIC overwrite


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 08-14-2014 , 07:10   [Solved] ROOT / ADMFLAG_GENERIC overwrite
Reply With Quote #1

Hi all,

if an admin has only the root flag "z", will this function return true?
PHP Code:
if (CheckCommandAccess(client"generic_admin"ADMFLAG_GENERICfalse))
{
    return 
true;
}
else
{
    return 
false;

Thanks for the effort.
__________________



Sorry for my very bad english
Greetings HSFighter

Last edited by HSFighter; 08-14-2014 at 07:52. Reason: Solved
HSFighter is offline
Send a message via ICQ to HSFighter
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 08-14-2014 , 07:51   Re: ROOT / ADMFLAG_GENERIC overwrite
Reply With Quote #2

Solvet!

Quote:
override_only
https://sm.alliedmods.net/api/index....d=show&id=497&
__________________



Sorry for my very bad english
Greetings HSFighter

Last edited by HSFighter; 08-14-2014 at 07:52.
HSFighter is offline
Send a message via ICQ to HSFighter
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 08-15-2014 , 17:59   Re: [Solved] ROOT / ADMFLAG_GENERIC overwrite
Reply With Quote #3

I believe override_only has nothing to do with your question here. Setting that parameter to true just means it won't search "generic_admin" as both a command and override but rather just the override.

Needless to say, root admins have the generic admin flag, b, too, so CheckCommandAccess here will return true.

I'd also point out that your code reads as: if CCA is true then return true, if false return false. Therefore you can shorten your code to:

PHP Code:
return CheckCommandAccess(client"generic_admin"ADMFLAG_GENERIC); 
Note you can also set override_only to true if you intend generic_admin to be just an override, and not a command.
__________________

Last edited by 11530; 08-15-2014 at 18:01.
11530 is offline
Reply


Thread Tools
Display Modes

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 07:03.


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