SA-MP Forums Archive
Help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help (/showthread.php?tid=484553)



Help - ViciousRoleplay123 - 31.12.2013

Код:
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


Re: Help - SilentSoul - 31.12.2013

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



Re: Help - ViciousRoleplay123 - 31.12.2013

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



Re: Help - SilentSoul - 31.12.2013

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.


Re: Help - ViciousRoleplay123 - 31.12.2013

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.


Re: Help - SilentSoul - 31.12.2013

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(...);



Re: Help - Smileys - 31.12.2013

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.