SA-MP Forums Archive
Prox Detector isn't working - 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: Prox Detector isn't working (/showthread.php?tid=455714)



Prox Detector isn't working - lramos15 - 02.08.2013

When I try to compile script I get errors wit the Prox Detector here is the code
Код HTML:
stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    foreach(Player,i)
    {
        if(!IsPlayerConnected(i))continue;
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z)) SendClientMessage(i,color,string);
    }
}
Here are the errors
Quote:

C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(84) : error 017: undefined symbol "foreach"
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(86) : error 017: undefined symbol "i"
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(86) : error 024: "break" or "continue" is out of context
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(87) : error 017: undefined symbol "i"
C:\Users\logan_000\Desktop\SAMP Server\gamemodes\lramos15.pwn(87) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


5 Errors.

Here is line 84:
Код HTML:
foreach(Player,i)
Here is line 86:
Код HTML:
if(!IsPlayerConnected(i))continue;
Here is line 87:
Код HTML:
if(IsPlayerInRangeOfPoint(i,radi,x,y,z)) SendClientMessage(i,color,string);



Re: Prox Detector isn't working - Pottus - 02.08.2013

You don't need this line if your using foreach

if(!IsPlayerConnected(i))continue;

Refer here https://sampforum.blast.hk/showthread.php?tid=92679


Re: Prox Detector isn't working - lramos15 - 02.08.2013

I'm not using foreach that's the thing, I found that proxydetector because I didn't know how to make one