Can't understand
#1

Ok. I create a variable.
pawn Код:
new i = 1;
if i try to make a function , something like this
pawn Код:
if(i))
{
// function
}
It took i = 1 , isn't ?

This is equivalent with this , isn't ?

pawn Код:
if(i == 1)
{
//function
}
Right ...

but if i do like this
pawn Код:
if(!i))
{
//function
}
It took i == 0 , whY?
Reply
#2

if(variable==1)
and
if(variable)
they are the same.
also
if(variable==0)
and
if(!variable)
are same aswell.
Reply
#3

You're not making a function, you're making an if statement. And yeah, that's just how the ! operator works...
Reply
#4

Quote:
Originally Posted by MenaceX^
if(variable==1)
and
if(variable)
they are the same.
also
if(variable==0)
and
if(!variable)
are same aswell.
No it isn't dude, "== 1" means it equals one.

pawn Код:
if ( blah == 1 )   //equals one
if ( blah )     //is true, is NOT false
if ( !blah )     //is false, is NOT true
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)