Prox Detector isn't working
#1

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);
Reply
#2

You don't need this line if your using foreach

if(!IsPlayerConnected(i))continue;

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)