Posts: 177
Threads: 35
Joined: Aug 2015
Reputation:
0
Hello. I'm just wondering if there is any optimal way to get the closest vehicle in front of player in the distance that equals to some specified amount, without any collision detecting plugin. What do you think guys?
Posts: 11,827
Threads: 33
Joined: Dec 2011
Reputation:
0
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).