Raised This Month: $ Target: $400
 0% 

Print To All Admins


Post New Thread Reply   
 
Thread Tools Display Modes
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-13-2009 , 13:16   Re: Print To All Admins
Reply With Quote #11

Quote:
Originally Posted by p3tsin View Post
... isnt that the same as this?

PHP Code:
if((GetUserFlagBits(client) & ADMFLAG_GENERIC|ADMFLAG_BAN|ADMFLAG_SLAY) == ADMFLAG_GENERIC|ADMFLAG_BAN|ADMFLAG_SLAY) {
    
//do stuff

If the player has the root flag, that won't work at all. It will only work if you use "& ADMFLAG_ROOT", so you'd have to do it like so:

PHP Code:
new flags GetUserFlagBits(client);
if ((
flags ADMFLAG_GENERIC|ADMFLAG_BAN|ADMFLAG_SLAY) == ADMFLAG_GENERIC|ADMFLAG_BAN|ADMFLAG_SLAY || (flags ADMFLAG_ROOT) == ADMFLAG_ROOT)
{
    
// do stuff

bl4nk is offline
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 11-13-2009 , 14:10   Re: Print To All Admins
Reply With Quote #12

Quote:
Originally Posted by bl4nk View Post
If the player has the root flag, that won't work at all. It will only work if you use "& ADMFLAG_ROOT", so you'd have to do it like so:

PHP Code:
new flags GetUserFlagBits(client);
if ((
flags ADMFLAG_GENERIC|ADMFLAG_BAN|ADMFLAG_SLAY) == ADMFLAG_GENERIC|ADMFLAG_BAN|ADMFLAG_SLAY || (flags ADMFLAG_ROOT) == ADMFLAG_ROOT)
{
    
// do stuff

Oh, that's true. Reminded me to add root checks for my admin stuff...
Btw, how do you do that with your CheckAdminFlags stock?
__________________
plop
p3tsin is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-13-2009 , 17:30   Re: Print To All Admins
Reply With Quote #13

By using their AdminId and GetAdminFlag it treats a root user as having all of the flags enabled on them, thus making it so you can check to see if they have certain flags or not regardless of them having the root flag.
bl4nk 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 14:16.


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