getvehicleid
#3

pawn Код:
stock GetClosestVehicle(playerid, Float: fRadius) // by RyDeR`
{
    new
        iClosestID = INVALID_VEHICLE_ID,
        Float: fFinalDistance,
        Float: fDistance,
        Float: fX,
        Float: fY,
        Float: fZ;
    GetPlayerPos(playerid, fX, fY, fZ);
    fFinalDistance = fRadius;

    for(new i; i != MAX_VEHICLES; i++)
    {
        if((fDistance = GetVehicleDistanceFromPoint(i, fX, fY, fZ)) < fFinalDistance)
        {
            fFinalDistance = fDistance;
            iClosestID = i;
        }
    }
    return iClosestID;
}
Reply


Messages In This Thread
getvehicleid - by Scofield62 - 28.12.2012, 21:24
Re: getvehicleid - by Scofield62 - 29.12.2012, 09:47
Re: getvehicleid - by Konstantinos - 29.12.2012, 09:50
Re: getvehicleid - by Scofield62 - 29.12.2012, 10:41

Forum Jump:


Users browsing this thread: 3 Guest(s)