[Ajuda] Sistema portamalas
#2

Tenta fazer alguma funзгo para fazer com que o player deva estar a 1 metro do portamalas do carro para poder abri-lo ex:
pawn Код:
//poe no seu comando /portamalas

            new contar = 0;
            new resultado;
            for(new i; i != MAX_VEHICLES; i++)
            {
                new distancia = ChecarDistanciaPlayerVeiculo(3.5, playerid, i);
                if(distancia)
                {
                    resultado = i;
                    countar++;
                }
            }

//coloca no fim de seu GM
stock ChecarDistanciaPlayerVeiculo(Float:radi, playerid, vehicleid)
{
    if(IsPlayerConnected(playerid))
    {
        new Float:PX,Float:PY,Float:PZ,Float:X,Float:Y,Float:Z;
        GetPlayerPos(playerid,PX,PY,PZ);
        GetVehiclePos(vehicleid, X,Y,Z);
        new Float:Distancia = (X-PX)*(X-PX)+(Y-PY)*(Y-PY)+(Z-PZ)*(Z-PZ);
        if(Distancia <= radi*radi)
        {
            return 1;
        }
    }
    return 0;
}
tenta usar isso ai
Reply


Messages In This Thread
Sistema portamalas - by billygod - 11.04.2014, 18:07
Re: Sistema portamalas - by hard_dalzot - 11.04.2014, 20:47
Re: Sistema portamalas - by billygod - 12.04.2014, 03:55
Re: Sistema portamalas - by hard_dalzot - 12.04.2014, 14:36
Re: Sistema portamalas - by billygod - 15.04.2014, 16:27
Re: Sistema portamalas - by williamgato - 15.04.2014, 18:04

Forum Jump:


Users browsing this thread: 1 Guest(s)