SA-MP Forums Archive
warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level - 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: warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level (/showthread.php?tid=598828)



warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level - yvoms - 17.01.2016

Im getting an error i have no clue on how to fix.
could anyone please assist me with this?
Thanks in advance

Код:
	
if(IsBeingSpeced[playerid] == 1)//If the player being spectated, disconnects, then turn off the spec mode for the spectator.
	{
	    foreach(Player,i)
	    {
	    	if(spectatorid[i] == playerid)
			{
				TogglePlayerSpectating(i,false);// This justifies what's above, if it's not off then you'll be either spectating your connect screen, or somewhere in blueberry (I don't know why)
			}
		}
	}
Edit: nevermind i fixed it, had to do it on the new way. foreach(new i : Player) fixed it.