SA-MP Forums Archive
error 001: expected token: ";", but found "new" - 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: error 001: expected token: ";", but found "new" (/showthread.php?tid=522646)



error 001: expected token: ";", but found "new" - mehdi171996 - 28.06.2014

hey all i found this error when i want to compile
error 001: expected token: ";", but found "new"
that's the script

new ZoneAttackTime[sizeof(ZoneInfo)];
new ZoneDeaths[sizeof(ZoneInfo)];
new ZoneAttacker[sizeof(ZoneInfo)] = {-1, ...};
new ZoneID[sizeof(ZoneInfo)];
new Teams[] = {
TEAM_GROVE,
TEAM_BALLAS,
TEAM_LOS_SANTOS_VAGOS,
TEAM_LOS_AZTECAS,

};

thx for help


Re: error 001: expected token: ";", but found "new" - icra - 28.06.2014

Did you defined TEAM_GROVE, TEAM_BALLAS etc.?
If not, TEAM_GROVE is being recognised as a string, so put " before and after it.


Re : Re: error 001: expected token: ";", but found "new" - mehdi171996 - 28.06.2014

Quote:
Originally Posted by icra
Посмотреть сообщение
Did you defined TEAM_GROVE, TEAM_BALLAS etc.?
If not, TEAM_GROVE is being recognised as a string, so put " before and after it.
i defined the teams
the probleme in this line
new ZoneAttackTime[sizeof(ZoneInfo)];


Re : error 001: expected token: ";", but found "new" - Clad - 28.06.2014

Can you tell which line cause the error ? And put the code between ?


Re : error 001: expected token: ";", but found "new" - mehdi171996 - 28.06.2014

Quote:
Originally Posted by Clad
Посмотреть сообщение
Can you tell which line cause the error ? And put the code between ?
this is the line

new ZoneAttackTime[sizeof(ZoneInfo)];


Re: error 001: expected token: ";", but found "new" - Jefff - 28.06.2014

before new ZoneAttackTime you are missing ;


Re : Re: error 001: expected token: ";", but found "new" - mehdi171996 - 28.06.2014

Quote:
Originally Posted by Jefff
Посмотреть сообщение
before new ZoneAttackTime you are missing ;
thx it works

+rep


Re: error 001: expected token: ";", but found "new" - Laurey - 28.06.2014

removed, above -.-


Re : error 001: expected token: ";", but found "new" - Clad - 28.06.2014

Quote:
Originally Posted by mehdi171996
Посмотреть сообщение
this is the line

new ZoneAttackTime[sizeof(ZoneInfo)];
Means the code needs ; before new.