about #definings
#1

hi,

can i define integers for matching later like this? :

pawn Код:
//definings
#define MODE_TDM    0,3,6

//later i want to compare them:
if(X==MODE_TDM)
Is it possible like that, would it work? (or would it just check the "0" in the if statement and wouldnt mind the other values?)


thanks
Reply
#2

No it wouldn't work like that, you will simple be asking if:

X = 0,3,6.

Use an array:

pawn Код:
new TDModes[]
{
     0, 3, 6
};
Then do the check like:

pawn Код:
for(new i = 0; i < sizeof(TDModes); i++)
{
     if(x==TDMode[I])
}
Reply
#3

Defining that is the same as doing
pawn Код:
if(X == 0,3,6)
Which is not valid.

EDIT: too slow
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)