[AJUDA] Usar cmd sу a 10 metros de distancia
#8

Bem BurnouT_, dei uma arrumada no public do ProxDetectorS para o mesmo responder apenas б 10 metros exatos de distancia, apesar de eu achar meio difнcil 2 jogadores estarem б 10 metros exatos.


Aqui estб, use-o em um if assim como o ProxDetectorS. Coloque o cуdigo abaixo no final do gamemode:

pawn Код:
stock DeZMetrOsProxDetectorS(Float:radi, playerid, targetid)
{
    if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new Float:posx, Float:posy, Float:posz;
        new Float:oldposx, Float:oldposy, Float:oldposz;
        new Float:tempposx, Float:tempposy, Float:tempposz;
        GetPlayerPos(playerid, oldposx, oldposy, oldposz);
        GetPlayerPos(targetid, posx, posy, posz);
        if(posx-oldposx==10 && posy-oldposy==10)
        {
            tempposx = (oldposx -posx);
            tempposy = (oldposy -posy);
            tempposz = (oldposz -posz);
            if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
            {
                return 1;
            }
        }
    }
    return 0;
}

Espero ter ajudado
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)