View Full Version : 6 weird 219 warnings

12/01/2015, 06:14 AM
Im getting at total 6 219 warnings: local variable "string" shadows a variable at a preceding level.
Some of them from ridiculous places, some has several warnings at one place, there's no global "new string" or anything like that.




EDIT: Fixed.

12/01/2015, 06:39 AM
Can you show me all the errors, and the lines of errors?

local variable "string" shadows a variable at a preceding level.
It means you've created a new variable 'string' 2 times, Like maybe one global and one with the same name inside a callback. just change the string to astring or str or anyting else..

12/01/2015, 07:09 AM
I already showed the lines with errors, and as you can see they're not global, some of them aren't even string-variables.

12/01/2015, 07:25 AM
Show the entire callback perhaps you are missing a bracket and post the errors.

12/01/2015, 07:53 AM
All warnings are "local variable "string" shadows a variable at a preceding level", as i said in the first post.
There's none other.
The first 4 warnings above seems to be always at the same lines, which can change when i edit the script.

Although the 2 warnings below have stayed, so they may be the "real" ones i guess, since the above doesn't make sense either.

13/01/2015, 10:43 AM
Bump, and update.
I tried a bracket program online too, found no missing brackets, and same amount of starting and closing brackets.

13/01/2015, 11:26 AM
Do you have a "string" field in one of your enums?
Those count as global variables as well.

13/01/2015, 02:02 PM
I know, i don't have any strings in my enums.

13/01/2015, 03:12 PM
I just realised that the 4 first errors are from the sscanf2 include, although i haven't edited, and it used to be fine?

14/01/2015, 04:49 PM

14/01/2015, 04:59 PM
You're using a string in the script which isn't used anywhere, just delete it.

14/01/2015, 06:19 PM
Im using formats and SendClientMessage to use the strings, and even if i wasn't using them, i think it would return a warning that it's unused.
But i can't see anywhere im not using the strings.

14/01/2015, 06:40 PM
You must have made a global string variable and that's why you're getting all of those warnings. Find it and delete it.

14/01/2015, 06:54 PM
I know that's what should cause the warning, and Rudy also said it, but i don't have any global strings.
They're all in stocks, publics and commands, there's none outside.

15/01/2015, 07:02 PM

15/01/2015, 07:12 PM
My suggestion is to try uninclude every include untill you see the error no more, this might be hard as you'll have to hide(/**/) the function for that include, or you could look in your includes for it, other way is to rename or just format the string, formatting the string already deletes it as you know.

16/01/2015, 05:37 AM
I'm getting the 4 first 219 warnings from the sscanf2, and stocks aren't working. It returns errors on stock functions, none on the stock itself.
Im only getting 1 219 warning if i rename sscanf2 to sscanf, but im using it in my script.

Fixed the OnPlayerText 219 warning by renaming "string" to "str".