#1

Код:
C:\Users\Taha Asif\Desktop\Backup\gamemodes\PCOD1.pwn(40) : error 001: expected token: "-identifier-", but found "-integer value-"
Line 40:
Код:
enum TeamCars
{
Terrorists, //line 40
Army
}
Anyone help? I am newbie so don't comment "So easy to fix NOOB" etc
Reply
#2

You missed a ';' at the end.
pawn Код:
enum TeamCars
{
Terrorists, //line 40
Army
};
Reply
#3

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
You missed a ';' at the end.
pawn Код:
enum TeamCars
{
Terrorists, //line 40
Army
};
Didn't work out:
Код:
C:\Users\Taha Asif\Desktop\Backup\gamemodes\PCOD1.pwn(40) : error 001: expected token: "-identifier-", but found "-integer value-"
And when i added ";":
Код:
C:\Users\Taha Asif\Desktop\Backup\gamemodes\PCOD1.pwn(42) : error 010: invalid function or declaration
Reply
#4

Because you have declare it wrong.
pawn Код:
enum TeamCars
{
Terrorists, //line 40
Army
};
new teamveh[MAX_VEHICLES][TeamCars];
After doing that you will get an error symbol is never used , untill you use it.
Reply
#5

Thanks for ur help SilentSoul, but it didn't work.
Anyway i fixed it by changing

Код:
enum TeamCars
{
Terrorists, //line 40
Army
};
new teamveh[MAX_VEHICLES][TeamCars];
Код:
enum TeamCars
{
terrorists,
army
}
Maybe those capital letters were causing the issue.
Reply
#6

pawn Код:
enum TeamCars
{
terrorists1,
army1,
terrorists2,
army2,//etc..
}
new teamveh[TeamCars];
You should use it to aviode any errors. like that
pawn Код:
teamveh[terrorists1] = CreateVehicle(463,-168.0218,1079.2097,19.2757,359.2158,0,0,120);
teamveh[army1] = CreateVehicle(...);
Reply
#7

Enumerators don't use ";" at the end, perhaps it's possible, but I never placed a ";" behind it.

pawn Код:
enum TeamCars
{
    terrorists1,
    army1,
    terrorists2,
    army2
}
new teamveh[ TeamCars ];
as you can see, I removed the ";" at the closing bracket of the enumerator, I also removed the "," behind "army2", it's because it's the last constant in the enumerator, if you put a "," behind the last one, it expects another constant again, so only use "," if you want to put another constant into that enumerator, under the last one.

the code above shouldn't return any errors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)