Macro error
#1

So, I'm getting one error every time I try to use this macro.

pawn Код:
#define PutInLocker(%0,%1,%2)  \
new found;
for(new i = 0; i < 6; i++) \
{  \
if(found == 1 || Locker[%0][i] != 0) continue; \
Locker[%0][i] = (%1); \
LockerAmount[%0][i] = (%2); \
found = 1; \
}
The error it gives me is
Код:
error 036: empty statement
There's quite a few calls to it, so I'll just elaborate by saying that the calls are all pretty similar to
pawn Код:
PutInLocker(playerid, item, amount);
And the gun and amount variables are stored from whatever it is they're storing.
Reply
#2

There was one replay but it disappeared :S

it just told you that you have a semicolon after the last brace (easy to see if you put the parameters in the marco)

pawn Код:
new found;
for(new i = 0; i < 6; i++)
{
if(found == 1 || Locker[playerid][i] != 0) continue;
Locker[playerid][i] = (item);
LockerAmount[playerid][i] = (amount);
found = 1;
}; //error
Reply
#3

Yeah, I replied but then saw that the thread had been reset or something. I'd just added a semicolon to the end of this line

Код:
#define PutInLocker(%0,%1,%2)
It worked.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)