"or if"
#1

Is there some way to describe "or if" in a sense, what I'm looking to do is a if statement for example,
pawn Код:
if(x or if y or if z == 1)
{
 do something
}

Described Version Below:
if(x/*or if*/y/*or if*/z/*if one of them equals 1 then do the thing, doesn't have to be them all*/ == 1)
Reply
#2

||

pawn Код:
if(x == 1 || y == 1) //turns to be if x = 1 or y = 1
Reply
#3

Maybe it will make things easier for you :

pawn Код:
// Top of your script
#define OR ||
#define AND &&

Example of usage:

pawn Код:
if (IsPlayerConnected(playerid) AND !IsPlayerNPC(playerid))
pawn Код:
if (MyVariable == 1 OR MyVariable == 2)
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)