{"hash":"0xC33AB876A77F8164","ns":"PED","name":"GET_CLOSEST_PED","slug":"GET_CLOSEST_PED","official":true,"named":true,"luaName":"GetClosestPed","game":"rdr3","apiset":"client","returnType":"BOOL","params":[{"name":"x","type":"float"},{"name":"y","type":"float"},{"name":"z","type":"float"},{"name":"radius","type":"float"},{"name":"p4","type":"BOOL"},{"name":"p5","type":"BOOL"},{"name":"outPed","type":"Ped*"},{"name":"p7","type":"BOOL"},{"name":"p8","type":"BOOL"},{"name":"p9","type":"BOOL"},{"name":"pedType","type":"int"}],"summary":"Gets the closest ped in a radius.","descriptions":[{"source":"alloc8or","format":"text","body":"Gets the closest ped in a radius."}],"examples":[],"aliases":[],"enums":[],"related":[],"build":"1207","gtaHash":"0xC33AB876A77F8164","gtaJhash":"0x8F6C1F55","sources":["alloc8or"],"doc":2,"url":"https://natives.borderlinerp.com/natives/PED/GET_CLOSEST_PED","markdownUrl":"https://natives.borderlinerp.com/natives/PED/GET_CLOSEST_PED.md","snippets":{"lua":"local retval, outPed = GetClosestPed(x, y, z, radius, p4, p5, p7, p8, p9, pedType)","luaInvoke":"local retval, outPed = Citizen.InvokeNative(0xC33AB876A77F8164, x, y, z, radius, p4, p5, Citizen.PointerValueInt(), p7, p8, p9, pedType, Citizen.ReturnResultAnyway())","js":"const [retval, outPed] = GetClosestPed(x, y, z, radius, p4, p5, p7, p8, p9, pedType);","jsInvoke":"const [retval, outPed] = Citizen.invokeNative('0xC33AB876A77F8164', x + 0.0000001, y + 0.0000001, z + 0.0000001, radius + 0.0000001, p4, p5, Citizen.pointerValueInt(), p7, p8, p9, pedType, Citizen.returnResultAnyway());","csharp":"var outPed = new OutputArgument();\nbool retval = Function.Call<bool>((Hash)0xC33AB876A77F8164, x, y, z, radius, p4, p5, outPed, p7, p8, p9, pedType);\n// outPed.GetResult<int>()","notes":["Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.","Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order."]}}