GetClosestObject
Finds the closest object within a specified distance from the player's current location.
Parameters
maxDistance
: The maximum distance within which to search for the model (number).
Returns
closestObj
: The object it foundclosestDist
: The distance to that objectclosestCoords
: The coords of the object
Usage
- Lua
- Javascript
local closestPed, closestDist, closestCoords = exports['FS-Lib']:GetClosestObject(10.0)
const [closestPed, closestDist, closestCoords] = exports['FS-Lib'].GetClosestObject(10.0)