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=311578)



error 001: expected token: ";", but found "new" - bestr32 - 17.01.2012

Guys help me please, I was making a Maths Question(something like contest...) and I got this error:
pawn Код:
C:\Documents and Settings\Alex\Desktop\SA-MP Server\gamemodes\XtremeGame.pwn(24) : error 001: expected token: ";", but found "new"
Can you help me? Those are line 24-32. (The Questions):
pawn Код:
new MathsQuestions[][] = {
    "How much is 100+132+32?",
    "How much is 50+30+10?",
    "How much is 10x10+10?",
    "How much is 2000+3000+1400?",
    "How much is 43719283712+1?", // I know this is weird lol.
    "How much is 340+340?",
    "How much is 200+130+320?"
};



Re: error 001: expected token: ";", but found "new" - Shadow_ - 17.01.2012

You need to add a ' ; ' to whatever is before line 24


Re: error 001: expected token: ";", but found "new" - Mark™ - 17.01.2012

pawn Код:
new MathsQuestions[7][0] = {
    "How much is 100+132+32?",
    "How much is 50+30+10?",
    "How much is 10x10+10?",
    "How much is 2000+3000+1400?",
    "How much is 43719283712+1?", // I know this is weird lol.
    "How much is 340+340?",
    "How much is 200+130+320?"
};
Try this, and tell me if you still get that error.


Re: error 001: expected token: ";", but found "new" - [Diablo] - 17.01.2012

what do you have before MathsQuestions array?


Re: error 001: expected token: ";", but found "new" - bestr32 - 17.01.2012

Thanks. I had
pawn Код:
new MathsAnswer = -1 // (without ;)
and I added it, no errors. Thank you very much Shadow-.


Re: error 001: expected token: ";", but found "new" - Shadow_ - 17.01.2012

Quote:
Originally Posted by bestr32
Посмотреть сообщение
Thanks. I had
pawn Код:
new MathsAnswer = -1 // (without ;)
and I added it, no errors. Thank you very much Shadow-.
No Problem.

Xtreme_playa; Why would you even bother commenting if you didn't read the error? EVEN though the error is in the title. :S