Raised This Month: $32 Target: $400
 8% 

Solved how to get two admin access?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 12-02-2021 , 12:54   how to get two admin access?
Reply With Quote #1

PHP Code:
        if(!(get_user_flags(id) & ADMIN_LEVEL_H)) {
            
CromChat(0"!w Admin!g [%s]!w moved an object after build time."adminname)
        }
        else {
            
CromChat(0"!w VIP!g [%s]!w moved an object after building time."adminname)
        } 
I have this, but what i wanted to do is, that people that has ADMIN_LEVEL_H will appear as VIP [%s] bla bla and people that has ADMIN_KICK, will get Admin [%s] bla bla
but in my code, people that have both, get that VIP message!
How can i do that people with admin level h get VIP moved after time, people with admin kick will get admin moved after time and people with both will get admin moved after time, since there are admins with vip flag!
Thank you!
__________________
a simple act of caring creates an endless ripple.

Last edited by Nutu_; 01-11-2022 at 11:23.
Nutu_ is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-02-2021 , 21:19   Re: how to get two admin access?
Reply With Quote #2

You just need to add the condition that VIP is only given to those with ADMIN_LEVEL_H and not ADMIN_KICK. To make it more comprehensible, I would flip the if statement logic (never do "if not" if you're also going to have an else statement, it makes it hard to read and understand).

One way to do this is like so:

PHP Code:

if( get_user_flags(id) & (ADMIN_LEVEL_H ADMIN_KICK) == ADMIN_LEVEL_H )
{
    
CromChat(0"!w VIP!g [%s]!w moved an object after building time."adminname)
}
else
{
    
CromChat(0"!w Admin!g [%s]!w moved an object after build time."adminname)

__________________
fysiks is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 12-03-2021 , 11:37   Re: how to get two admin access?
Reply With Quote #3

thanks, it worked!
__________________
a simple act of caring creates an endless ripple.
Nutu_ 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 20:50.


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