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

Admin Check where some players have some admin flags


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
the133448
Junior Member
Join Date: Apr 2017
Old 04-29-2017 , 10:55   Admin Check where some players have some admin flags
Reply With Quote #1

Hello,

Im creating a plugin and it needs to have an admin Bypass, however I cant do what I normally do which is check for admin flags as some VIP's on the server have admin custom flag 5,6.

How can i check that?


if(GetUserAdmin(client) != INVALID_ADMIN_ID)
{
}

else
{
the133448 is offline
wwahgnerbp
Member
Join Date: Mar 2013
Location: Earth, Solar System
Old 04-29-2017 , 11:13   Re: Admin Check where some players have some admin flags
Reply With Quote #2

the correct way to check admin flags is doing something like this

Code:
int flags = GetUserFlagBits(client);

if( flags & ADMFLAG_CUSTOM6)
{
      // Client flag is "t", do something...
}
You can find more info here: https://wiki.alliedmods.net/Checking...Mod_Scripting)

Last edited by wwahgnerbp; 04-29-2017 at 11:14.
wwahgnerbp is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 04-29-2017 , 11:29   Re: Admin Check where some players have some admin flags
Reply With Quote #3

Quote:
Originally Posted by wwahgnerbp View Post
the correct way to check admin flags is doing something like this

Code:
int flags = GetUserFlagBits(client);

if( flags & ADMFLAG_CUSTOM6)
{
      // Client flag is "t", do something...
}
You can find more info here: https://wiki.alliedmods.net/Checking...Mod_Scripting)
The correct way is: https://sm.alliedmods.net/new-api/co...kCommandAccess
And you clearly did not read the wiki you sent, as it even states this:
Quote:
The last fallback: GetAdminFlag / GetUserFlagBits
These two commands are the brute force method and should only be used as a last resort. You should always use CheckCommandAccess in preference to this.
__________________
xines is offline
wwahgnerbp
Member
Join Date: Mar 2013
Location: Earth, Solar System
Old 04-29-2017 , 11:45   Re: Admin Check where some players have some admin flags
Reply With Quote #4

Quote:
Originally Posted by xines View Post
The correct way is: https://sm.alliedmods.net/new-api/co...kCommandAccess
And you clearly did not read the wiki you sent, as it even states this:
I always do like that. It doesn't means that it is the most correct way. I admit that I stated it wrongly. I should've said that it was a possibility. Sorry anyways.

ps: If you want to check access to something you should use CheckCommandAccess but if you just want to see if the client has or not certain flags you can do like I said. It's more practical.

Last edited by wwahgnerbp; 04-29-2017 at 11:52. Reason: ps:
wwahgnerbp 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:34.


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