RedM Natives

GET_SCENARIO_POINTS_IN_AREA

Hash0x345EC3B7EBDE1CB5
Runtime nameGetScenarioPointsInArea
NamespaceTASK
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

NameTypeDescription
posXfloat—
posYfloat—
posZfloat—
radiusfloat—
scenariosInRadiusAny*—
sizeint—

Returns int

Description

Note: scenariosInRadius is an array, and its size and values should be aligned to 8 bytes.

Usage

Lua
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#
JavaScript
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());
C#
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. 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.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

See also

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.