{"hash":"0xF4860514AD354226","ns":"PED","name":"_COUNT_PEDS_AWARE_OF_EVENT","slug":"_COUNT_PEDS_AWARE_OF_EVENT","official":false,"named":true,"luaName":"CountPedsAwareOfEvent","game":"rdr3","apiset":"client","returnType":"int","params":[{"name":"shockingEvent","type":"ScrHandle"},{"name":"x","type":"float"},{"name":"y","type":"float"},{"name":"z","type":"float"},{"name":"radius","type":"float"},{"name":"entities","type":"Any*"}],"summary":"Counts how many peds are aware of a shocking event within a radius.","descriptions":[{"source":"alloc8or","format":"text","body":"Counts how many peds are aware of a shocking event within a radius.\nThe eventHandle is from ADD_SHOCKING_EVENT_FOR_ENTITY. The entities output collection is capped at 15 in observed code and is used to drive reactions/tasks for the affected peds."},{"source":"vorp","format":"text","body":"Only used in SP Scripts\ncounts how many peds that the ADD_SHOCKING_EVENT_FOR_ENTITY were add to based on position and radius, p0 is handleId from ADD_SHOCKING_EVENT_FOR_ENTITY\np3 is a collection of entities where max is 15 (in source code), its using itemSet to get them from a volume\nthis count seems to be used to add a task reactions etc to these peds"}],"examples":[],"aliases":[],"enums":[],"related":[],"build":"1207","sources":["alloc8or","vorp"],"doc":2,"url":"https://natives.borderlinerp.com/natives/PED/_COUNT_PEDS_AWARE_OF_EVENT","markdownUrl":"https://natives.borderlinerp.com/natives/PED/_COUNT_PEDS_AWARE_OF_EVENT.md","snippets":{"lua":"local retval, entities = CountPedsAwareOfEvent(shockingEvent, x, y, z, radius, entities)","luaInvoke":"local retval, entities = Citizen.InvokeNative(0xF4860514AD354226, shockingEvent, x, y, z, radius, Citizen.PointerValueIntInitialized(entities), Citizen.ResultAsInteger())","js":"const [retval, entities] = CountPedsAwareOfEvent(shockingEvent, x, y, z, radius, entities);","jsInvoke":"const [retval, entities] = Citizen.invokeNative('0xF4860514AD354226', shockingEvent, x + 0.0000001, y + 0.0000001, z + 0.0000001, radius + 0.0000001, Citizen.pointerValueIntInitialized(entities), Citizen.returnResultAnyway(), Citizen.resultAsInteger());","csharp":"var entities = new OutputArgument();\nint retval = Function.Call<int>((Hash)0xF4860514AD354226, shockingEvent, x, y, z, radius, entities);\n// entities.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.","The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.","`Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.","The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works."]}}