GetClosestCar
#8

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
It's untested, but it should work fine...

pawn Код:
stock GetClosestVehicle(playerid)
{
    new
        Float:fPos[3],
        Float:distance = 30,
        Float:curdistance,
        currentVehicle;
   
    for(new v = 0; v < MAX_VEHICLES; v++)
    {
        GetVehiclePos(v, fPos[0], fPos[1], fPos[2]);       
        curdistance = GetPlayerDistanceFromPoint(playerid, fPos[0], fPos[1], fPos[2]);
       
        if(curdistance < distance)
        {
            currentVehicle = v;
            distance = curdistance;
        }
    }
    return currentVehicle;
}
Worked, tyvm
Reply


Messages In This Thread
GetClosestCar - by Stefand - 09.05.2013, 18:33
Re: GetClosestCar - by TheStreetsRP - 09.05.2013, 18:48
Re: GetClosestCar - by Stefand - 09.05.2013, 20:11
Re: GetClosestCar - by zxc1 - 09.05.2013, 20:16
Re: GetClosestCar - by Stefand - 09.05.2013, 20:29
Re: GetClosestCar - by Scenario - 09.05.2013, 20:38
Re: GetClosestCar - by cessil - 09.05.2013, 21:34
Re: GetClosestCar - by Stefand - 09.05.2013, 21:40

Forum Jump:


Users browsing this thread: 1 Guest(s)