como hacer...
#1

que un comando funcione cuando un jugador este serca de otro jugador unos 3 metro o mas.
Reply
#2

pawn Код:
forward JugadorCercaDeJugador(Float:R, playerid, targetid);
public JugadorCercaDeJugador(Float:R, playerid, targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new Float:aX, Float:aY, Float:aZ;
        new Float:bX, Float:bY, Float:bZ;
        new Float:X, Float:Y, Float:Z;
        GetPlayerPos(playerid, bX, bY, bZ);
        GetPlayerPos(targetid, aX, aY, aZ);
        X = (bX - aX);
        Y = (bY - aY);
        Z = (bZ - aZ);
        if (((X < R) && (X > -R)) && ((Y < R) && (Y > -R)) && ((Z < R) && (Z > -R)))
        {
            return 1;
        }
    }
    return 0;
}
Y para el comando pones un
pawn Код:
if(JugadorCercaDeJugador(5.0, playerid, jugador2))
{
//Comando
}
Creditos: Sacado del ProxdetectorS del Ravens 0.3c
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)