Skip to main content

GetClosestPed

ESX.Game.GetClosestPed(coords, modelFilter)

This function returns the closest ped handle, and distance to the ped.

Arguments

ArgumentData TypeOptionalDefault ValueExplanation
coordstableYes(your player ped coords)Coords to search at
modelFiltertable&vector3Yes-Enables whitelist mode for getting closest ped. The table must be key-value where the key is the model hash, and value set to true.