Help: /breaklock command (Car Jacker)
#4

Sure,

Here it is:
pawn Код:
stock GetNearestVehicle(playerid, Float:dis)
{
    new Float:L, Float:O, Float:II;
    if(GetPlayerPos(playerid, L, O, II))
    {
        new vehicleid = INVALID_VEHICLE_ID;
        for(new v, Float:temp, Float:VL, Float:VO, Float:VII; v != MAX_VEHICLES; v++)
        {
            if(GetVehiclePos(v, VL, VO, VII) && v != GetPlayerVehicleID(playerid))
            {
                VL -= L, VO -= O, VII -= II;
                temp = VL * VL + VO * VO + VII * VII;
                if(temp < dis) dis = temp, vehicleid = v;
            }
        }
        dis = floatpower(dis, 1.5);
        return vehicleid;
    }
    return INVALID_VEHICLE_ID;
}
Thanks in advance!
Reply


Messages In This Thread
Help: /breaklock command (Car Jacker) - by jakejohnsonusa - 05.02.2013, 01:59
Re: Help: /breaklock command (Car Jacker) - by ThePhenix - 05.02.2013, 02:02
Re: Help: /breaklock command (Car Jacker) - by Threshold - 05.02.2013, 07:47
Re: Help: /breaklock command (Car Jacker) - by jakejohnsonusa - 05.02.2013, 19:35
Re: Help: /breaklock command (Car Jacker) - by jakejohnsonusa - 06.02.2013, 19:40

Forum Jump:


Users browsing this thread: 1 Guest(s)