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

!= is not, but how what if & ???


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 01-01-2011 , 13:37   != is not, but how what if & ???
Reply With Quote #1

Hey, I wan't to check

if(get_user_flags(someone1) & ADMIN_LEVEL_H && get_user_flags(someone2) **IS NOT [ !& - not working ;D ] ** ADMIN_LEVEL_H)

!(get_user_flags(someone2) & ADMIN_LEVEL_H) ??

Last edited by reinert; 01-01-2011 at 13:40.
reinert is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-01-2011 , 13:56   Re: != is not, but how what if & ???
Reply With Quote #2

You answer yourself and that's something you could test alone.
__________________
Arkshine is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-01-2011 , 14:08   Re: != is not, but how what if & ???
Reply With Quote #3

yeah I found solution, but I didn't know is it good, so thanks for ur answer too
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-01-2011 , 14:46   Re: != is not, but how what if & ???
Reply With Quote #4

Not to confuse you, but another way is this:

Code:
if( ~get_user_flags(someone2) & ADMIN_LEVEL_H ) {     // someone2 does NOT have ADMIN_LEVEL_H }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 01-01-2011 , 14:49   Re: != is not, but how what if & ???
Reply With Quote #5

Thanks.
reinert is offline
marquezs
Member
Join Date: Jun 2010
Old 01-01-2011 , 21:01   Re: != is not, but how what if & ???
Reply With Quote #6

Quote:
Originally Posted by Exolent[jNr] View Post
Not to confuse you, but another way is this:

Code:
if( ~get_user_flags(someone2) & ADMIN_LEVEL_H ) {     // someone2 does NOT have ADMIN_LEVEL_H }
is it the same as this

Code:
if(!(get_user_flags(someone2) & ADMIN_LEVEL_H)) {     // someone2 does NOT have ADMIN_LEVEL_H }
marquezs is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-01-2011 , 21:27   Re: != is not, but how what if & ???
Reply With Quote #7

Quote:
Originally Posted by marquezs View Post
is it the same as this

Code:
if(!(get_user_flags(someone2) & ADMIN_LEVEL_H)) {     // someone2 does NOT have ADMIN_LEVEL_H }
The result is the same, yes, it's just done differently internally.
__________________
fysiks is offline
marquezs
Member
Join Date: Jun 2010
Old 01-01-2011 , 21:52   Re: != is not, but how what if & ???
Reply With Quote #8

Ok, thanks. And which one is more efficient? Or it doesn't matter since it's so little code
marquezs is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 01-01-2011 , 21:55   Re: != is not, but how what if & ???
Reply With Quote #9

Only way to tell that is to profile it.
https://forums.alliedmods.net/showthread.php?t=67752
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
marquezs
Member
Join Date: Jun 2010
Old 01-01-2011 , 21:57   Re: != is not, but how what if & ???
Reply With Quote #10

Ok, I'll try it, thank you
marquezs 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 13:58.


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