Quote:
Originally Posted by Danyal
pawn Code:
forward GetClosestVehicle(carid); public GetClosestVehicle(carid) { new x,Float:dis,Float:dis2,car; car = 0; dis = 99999.99; for ( x = 0; x < MAX_VEHICLES; x++ ) { if(x != carid) { dis2 = GetDistanceBetweenVehicles(x,carid); if(dis2 < dis && dis2 < 8.0) { dis = dis2; car = x; } } } return car; }
i dont under your english becoz i am not good at english but i think you want that function...
|
Close, but it's from a standing player to a vehicle.