SA-MP Forums Archive
undefined symbol,expected token,invalid expression - 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: undefined symbol,expected token,invalid expression (/showthread.php?tid=529104)



undefined symbol,expected token,invalid expression - ShiffeyTheGamer - 31.07.2014

I get these errors when I compile my script,
Код:
(14755) : error 017: undefined symbol "StopSign"
(14755) : error 001: expected token: ";", but found "]"
(14755) : error 029: invalid expression, assumed zero
What is at the line:
Код:
	StopSign[1] = CreateDynamicObject(16023, 114.6947, 1191.3103, 17.6388   0.0000, 0.0000, -26.4600);
I really dont know what is wrong with it, Help please!!


Re: undefined symbol,expected token,invalid expression - Stinged - 31.07.2014

Do you have a "new StopSign[(Some number)];" anywhere?


Re: undefined symbol,expected token,invalid expression - ShiffeyTheGamer - 31.07.2014

Код:
new StopSigns[1];
Yep.


Re: undefined symbol,expected token,invalid expression - Isolated - 31.07.2014

[1] = 1 item, the 1st item in an array is 0.

pawn Код:
StopSign[0] = CreateDynamicObject(16023, 114.6947, 1191.3103, 17.6388   0.0000, 0.0000, -26.4600);
Forgot to mention, if you already have StopSign[0], you can just increase new StopSign[1] to StopSign[2].

Allow me to explain a little more.

VariableName[] is the beginning of an array. This is allowed but really not recommended. You are allowing the array to be filled with thousands of values and not needed in your case.

VariableName[1] means there is 1 item in the array, VariableName[128] there is 128 items in the array.


Re: undefined symbol,expected token,invalid expression - SpikY_ - 31.07.2014

Quote:
Originally Posted by ShiffeyTheGamer
Посмотреть сообщение
I get these errors when I compile my script,
Код:
(14755) : error 017: undefined symbol "StopSign"
(14755) : error 001: expected token: ";", but found "]"
(14755) : error 029: invalid expression, assumed zero
What is at the line:
Код:
	StopSign[1] = CreateDynamicObject(16023, 114.6947, 1191.3103, 17.6388   0.0000, 0.0000, -26.4600);
I really dont know what is wrong with it, Help please!!
check show me the line where you have put " new StopSign; "


Re: undefined symbol,expected token,invalid expression - SpikY_ - 31.07.2014

Quote:
Originally Posted by Isolated
Посмотреть сообщение
[1] = 1 item, the 1st item in an array is 0.

pawn Код:
StopSign[0] = CreateDynamicObject(16023, 114.6947, 1191.3103, 17.6388   0.0000, 0.0000, -26.4600);
Isolated is right ..

EDIT: remove "[1]" from tht line


Re: undefined symbol,expected token,invalid expression - ShiffeyTheGamer - 31.07.2014

Quote:
Originally Posted by NGEN123
Посмотреть сообщение
Isolated is right ..

EDIT: remove "[1]" from tht line
And replace with 0?


Re: undefined symbol,expected token,invalid expression - SpikY_ - 31.07.2014

no just remove [1] if again given error so place [0] there

if i help you so plz rep+ me



Re: undefined symbol,expected token,invalid expression - Stinged - 31.07.2014

What the hell are you talking about NGEN123...

Just do what Isolated said.

You used StopSign[1] = ...
Use StopSign[0] instead.


Re: undefined symbol,expected token,invalid expression - SpikY_ - 31.07.2014

Sorry .. i just give him suggestion. i have test it thts why i say him .. btw isolate is gooder then me