I’m trying to use the GetClosestPed function like this :
local coords = GetEntityCoords(GetPlayerPed(-1))
local ped
if GetClosestPed(coords["x"], coords["y"], coords["z"], 5.0, true, false, ped, true, true, -1) then
Citizen.Trace("There is a ped !")
Citizen.Trace(DumpTable(ped))
else
Citizen.Trace("No ped")
end
But ped doesn’t seem to change, it’s a nil anyway. Is there a way to have an out/ref parameter in lua ?
Edit : Where did you get the function documentation ? I’m using http://www.dev-c.com/nativedb/ but it doesn’t say which parameter is what, it only says “Any” if it’s not void