28.05.2016, 19:25
GetPlayerCameraTargetVehicle will return the vehicle the player is looking at (but always returns the closest even if it's at the side). About the distance thing I'm not so sure, depending on what you want to do. Getting the distance between vehicle and player and if it is not somewhat equal to that specified amount, return that there's no vehicle or detect it with other way (looping and such is not very efficient unless you have an custom iterator with all the streamed vehicles for each player).