Raised This Month: $ Target: $400
 0% 

operator question


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-23-2011 , 07:39   operator question
Reply With Quote #1

is this true?
PHP Code:
if ( get_user_flags(id) && ADMIN_LEVEL_A 
is the same as

PHP Code:
if ( get_user_flags(id) & ADMIN_LEVEL_A 
Just need an answer , have tried the first method still no error but I curious with the second method .
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
Snaker beatter
Veteran Member
Join Date: Sep 2011
Location: Manila, Philippines
Old 12-23-2011 , 07:42   Re: operator question
Reply With Quote #2

NO:
&&: i known its just a shortcut of two 'if' native:

PHP Code:
// This:
if (native1 && native2)

// And this:
if (native1)
{
       if (
native2)
       {
       }
}

// Are same 
-------------------

Like: if (is_user_alive(id) && cs_get_user_team(id) == CS_TEAM_T:::

PHP Code:
if (is_user_alive(id)
{
       if (
cs_get_user_team(id) == CS_TEAM_T)
       {
       }

__________________

Last edited by Snaker beatter; 12-23-2011 at 07:52.
Snaker beatter is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 12-23-2011 , 08:15   Re: operator question
Reply With Quote #3

&& is the logical AND operator.
& is a bitwise operator.

Read more about the operators here:
http://www.compuphase.com/pawn/Pawn_Language_Guide.pdf
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-23-2011 , 11:47   Re: operator question
Reply With Quote #4

Quote:
Originally Posted by drekes View Post
&& is the logical AND operator.
& is the bitwise AND operator.
Just a little fix .
__________________
fysiks 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 12:02.


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