SA-MP Forums Archive
foreach warning - 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: foreach warning (/showthread.php?tid=619505)



foreach warning - MrCesar - 18.10.2016

hey what does that mean?
Код:
C:\Users\Shani\Desktop\Anonymous Creek Roleplay\filterscripts\rpchats.pwn(43) : warning 219: local variable "using_deprecated_foreach_syntax" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.
this is the code:
Код:
stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i) // error line
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}
thanks in advance


Re: foreach warning - Konstantinos - 18.10.2016

Deprecated version, use:
pawn Код:
foreach(new i : Player)



Re: foreach warning - MrCesar - 18.10.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Deprecated version, use:
pawn Код:
foreach(new i : Player)
thanks