• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] warning 219: local variable "i" shadows a variable at a preceding level
#1
There is not any global variable i, you know how to solve this warning? its annoying.
  Reply
#2
Probably in a 3rd party library you added before getting this warning
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#3
(2021-02-09, 02:18 AM)Pinch Wrote: Probably in a 3rd party library you added before getting this warning

Its strange. When i compile with pawno it doesnt appear. But if i compile the pwn file with sublime text it appear.
  Reply
#4
(2021-02-09, 04:46 AM)Zett0x Wrote:
(2021-02-09, 02:18 AM)Pinch Wrote: Probably in a 3rd party library you added before getting this warning



Its strange. When i compile with pawno it doesnt appear. But if i compile the pwn? file with sublime text it appear.



Looks like the directory of the pawncc.exe for sublime text is different to the one in your gamemode. Check that.
  Reply
#5
(2021-02-09, 02:18 AM)Pinch Wrote: Probably in a 3rd party library you added before getting this warning



(2021-02-09, 05:21 PM)Chessy Wrote:
(2021-02-09, 04:46 AM)Zett0x Wrote:
(2021-02-09, 02:18 AM)Pinch Wrote: Probably in a 3rd party library you added before getting this warning



Its strange. When i compile with pawno it doesnt appear. But if i compile the pwn? file with sublime text it appear.



Looks like the directory of the pawncc.exe for sublime text is different to the one in your gamemode. Check that.



No, it is the same directory, and the same compiler. When i use sublime text for compiling x.pwn, the warning appear, when i use the compiler with cmd (pawncc.exe x.pwn) the error appear BUT when i used the old IDE pawno(in the same directory of the project), that error doesnt appear.



I tried to replace "i" for "index",(control) and the error appear again(warning 219: local variable "index" shadows a variable at a preceding level). I don?t know what is happening.?

Someone can help me?

The other warnings that i have is :?warning 213: tag mismatch: expected tags "Float", or none ("_"); but found "PlayerText" BECAUSE:



<

Quote:new PlayerText:drawid=CreatePlayerTextDraw(playerid,100.0,100.0,"Cargando texturas...");

? ? PlayerTextDrawShow(playerid,drawid);

SetTimerEx("spawn",3000,0,"di",playerid,drawid);





How can in pass a PlayerText tipe in the SetTimerEx? im starting to think that i have to ignore this strange warnings.
  Reply
#6
Quote:he other warnings that i have is : warning 213: tag mismatch: expected tags "Float", or none ("_"); but found "PlayerText" BECAUSE:
Note the definition of function SetTimerEx:
Code:
native SetTimerEx(funcname[], interval, repeating, const format[], /*>>*/{Float,_}:/*<<*/...);
Just like the warning says, it expects either a variable with tag none (_) or Float. Either change the definition of the function or force pass it with no tag (that is what you should do)
Code:
SetTimerEx("spawn", 3000, 0, "ii", playerid, _:drawid);
  Reply


Forum Jump: