Help with "if ()"
#1

Hello,
Today idk how i forget all about "if"lol
Can someone help me? Like
Код:
 
If (SomeThing[playerid] == 0) return 1;
//now what to do to make something happen if it = 1?!
Reply
#2

Quote:
Originally Posted by oktokt1
Посмотреть сообщение
Hello,
Today idk how i forget all about "if"lol
Can someone help me? Like
Код:
 
If (SomeThing[playerid] == 0) return 1;
//now what to do to make something happen if it = 1?!
Like uf i want to make
If Something = 1 thn msg to player with "somting enabled"
If Something = 0 then msg "somting disabled"
Sorry for re post it was by mistake .
Reply
#3

PHP код:
if(something == 1) { 
// do smth
}
else if(
something == 0) { 
// do smth
}
// alternatively you can use:
if(something// equals to 1.
else if(!something// equals to 0. 
Reply
#4

I got it thanx alot.
Reply
#5

Quote:
Originally Posted by PawnHunter
Посмотреть сообщение
PHP код:
if(something == 1) { 
if(
something// equals to 1.
else if(!something// equals to 0. 
Actually those mean
Код:
if (something) // means if (something >= 1) not if (something == 1)
else if (!something) // means if (something < 1) not if (something == 0)
Reply
#6

Actually
pawn Код:
if(!something) //Will execute ONLY when something == 0
if(something) //Will execute for everthing different than 0, meaning: 1, 666, -1, -10.2, etc.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)