SA-MP Forums Archive
I got an error - 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: I got an error (/showthread.php?tid=609626)



I got an error - Progamerisrael1 - 14.06.2016

Код:
C:\Users\NivZiv\Desktop\YourGame\pawno\include\MidoStream.inc(27) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\NivZiv\Desktop\YourGame\pawno\include\MidoStream.inc(33) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\NivZiv\Desktop\YourGame\pawno\include\MidoStream.inc(41) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\NivZiv\Desktop\pawno\include\MidoStream.inc(49) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\NivZiv\Desktop\YourGame\pawno\include\MidoStream.inc(55) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\NivZiv\Desktop\YourGame\pawno\include\MidoStream.inc(61) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\NivZiv\Desktop\YourGame\pawno\include\MidoStream.inc(67) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\NivZiv\Desktop\YourGame\pawno\include\Y_Objects.inc(123) : warning 201: redefinition of constant/macro (symbol "foreach(%1,%2)")



Re: I got an error - Konstantinos - 14.06.2016

You have declared "id" as global variable to your script which is also declared in MidoStream.inc file. Rename it to something else to get rid of the warnings 219.

As for the warning 201, "foreach" is already defined either in stand-alone foreach.inc file or as y_iterate.inc from YSI library. Open Y_Objects and rename "foreach" to some other name such as "for_loop". Even though, I wouldn't advise such style as it is not that hard to tap 5-10 buttons more.


Re: I got an error - Progamerisrael1 - 14.06.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You have declared "id" as global variable to your script which is also declared in MidoStream.inc file. Rename it to something else to get rid of the warnings 219.

As for the warning 201, "foreach" is already defined either in stand-alone foreach.inc file or as y_iterate.inc from YSI library. Open Y_Objects and rename "foreach" to some other name such as "for_loop". Even though, I wouldn't advise such style as it is not that hard to tap 5-10 buttons more.
How I can fix it?


Re: I got an error - Konstantinos - 14.06.2016

I've told you the solution to both: re-naming those symbols will fix it.


Re: I got an error - Progamerisrael1 - 14.06.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I've told you the solution to both: re-naming those symbols will fix it.
Yeah but how I re-name it, re-name "id" to "id1"


Re: I got an error - Progamerisrael1 - 14.06.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
I've told you the solution to both: re-naming those symbols will fix it.
Can you tell me what to do, step by step?


Re: I got an error - Konstantinos - 14.06.2016

To start off, is it necessary the variable you had declared "id" to be a global?

- If not, use local variables.
- If yes, re-name it to some other name. Have a name that will give a hint of what the variable is for.

---

Open Y_Objects.inc file and CTRL + H. Replace "foreach" with "for_loop" or whatever name you want.


Re: I got an error - Sew_Sumi - 14.06.2016

Midostream... Now that's something that is old as the hills. Any reason why you are using that old an include?