Error en el Proxdetector
#1

Hola buenas noches, me gustaria que me colaboraran en este cуdigo... Me estoy enfrentando al script de pawn desde 0 y pues eh visto varias GM con el proxdetector donde mide la distancia radial para que pueda ser leido un texto enviado por el usuario, sino me equivoco entonces pues hice esto

Код:
ProxDetector(Float:radi, playerid, string[], col1, col2, col3, col4, col5)
{
    new Float:pPosition[3], Float:oPosition[3];
    GetPlayerPos(playerid, pPosition[0], pPosition[1], pPosition[2]);
    foreach(new i: Player)
    {
        if (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i))
        {
	        GetPlayerPos(i, oPosition[0], oPosition[1], oPosition[2]);
	        if(IsPlayerInRangeOfPoint(i, radi / 16, pPosition[0], pPosition[1], pPosition[2])) { SendClientMessageEx(i, col1, string); }
	        else if(IsPlayerInRangeOfPoint(i, radi / 8, pPosition[0], pPosition[1], pPosition[2])) { SendClientMessageEx(i, col2, string); }
	        else if(IsPlayerInRangeOfPoint(i, radi / 4, pPosition[0], pPosition[1], pPosition[2])) { SendClientMessageEx(i, col3, string); }
	        else if(IsPlayerInRangeOfPoint(i, radi / 2, pPosition[0], pPosition[1], pPosition[2])) { SendClientMessageEx(i, col4, string); }
	        else if(IsPlayerInRangeOfPoint(i, radi, pPosition[0], pPosition[1], pPosition[2])) { SendClientMessageEx(i, col5, string); }
        }
    }
    return 1;
}
Los Errores que me arrojan al compilar son estos

Код:
C:\Program Files\Rockstar Games\GMYsql\gamemodes\roleplay.pwn(275) : error 017: undefined symbol "foreach"
C:\Program Files\Rockstar Games\GMYsql\gamemodes\roleplay.pwn(275) : error 029: invalid expression, assumed zero
C:\Program Files\Rockstar Games\GMYsql\gamemodes\roleplay.pwn(275) : error 017: undefined symbol "Player"
C:\Program Files\Rockstar Games\GMYsql\gamemodes\roleplay.pwn(275) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Segъn entiendo tengo variables indefinidas pero el Foreach no es una variable o si?
y el erro 029 Que significa?

Muchas gracias a los colaboradores y a todos por tomar el tiempo de leer el post.
Reply
#2

No, foreach es una funciуn en cierta forma que hace el trabajo de los bucles aplicados por ejemplo a recorrer el ID de todos los jugadores conectados.

https://sampforum.blast.hk/showthread.php?tid=570868

Incluirlo a tu cуdido
Reply
#3

Aсade esto:

pawn Код:
#include <foreach>
Reply
#4

Entiendo. Muchas gracias ya pueden cerrar el tema. [Solucionado]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)