GET_SCENARIO_POINTS_IN_AREA
Hash
0x345EC3B7EBDE1CB5Runtime name
GetScenarioPointsInAreaNamespaceTASK
SideClient
NameOfficial
Docs
Since build1207
Signature
int GET_SCENARIO_POINTS_IN_AREA(float posX, float posY, float posZ, float radius, Any* scenariosInRadius, int size);Parameters
| Name | Type | Description |
|---|---|---|
posX | float | — |
posY | float | — |
posZ | float | — |
radius | float | — |
scenariosInRadius | Any* | — |
size | int | — |
Returns int
Description
Note: scenariosInRadius is an array, and its size and values should be aligned to 8 bytes.
Usage
local retval, scenariosInRadius = GetScenarioPointsInArea(posX, posY, posZ, radius, size)
-- always works, by hash
local retval, scenariosInRadius = Citizen.InvokeNative(0x345EC3B7EBDE1CB5, posX, posY, posZ, radius, Citizen.PointerValueInt(), size, Citizen.ResultAsInteger())JavaScript and C#
const [retval, scenariosInRadius] = GetScenarioPointsInArea(posX, posY, posZ, radius, size);
// by hash
const [retval, scenariosInRadius] = Citizen.invokeNative('0x345EC3B7EBDE1CB5', posX + 0.0000001, posY + 0.0000001, posZ + 0.0000001, radius + 0.0000001, Citizen.pointerValueInt(), size, Citizen.returnResultAnyway(), Citizen.resultAsInteger());var scenariosInRadius = new OutputArgument();
int retval = Function.Call<int>((Hash)0x345EC3B7EBDE1CB5, posX, posY, posZ, radius, scenariosInRadius, size);
// scenariosInRadius.GetResult<int>()- Float parameters: Lua integers (
10, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to 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.
Any*arguments are often structs. Build them with a DataView buffer and pass it with:Buffer()— see the examples and notes below.
See also
_RESET_SCENARIO_POINTS_IN_AREAResets/clears all scenario entities within the given spherical area
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.