# TASK::GET_SCENARIO_POINTS_IN_AREA

- **Hash:** `0x345EC3B7EBDE1CB5`
- **Namespace:** TASK
- **Runtime name (Lua/JS):** `GetScenarioPointsInArea`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/TASK/GET_SCENARIO_POINTS_IN_AREA

## Signature

```c
int GET_SCENARIO_POINTS_IN_AREA(float posX, float posY, float posZ, float radius, Any* scenariosInRadius, int size);
```

## Parameters

- `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

### Lua

```lua
local retval, scenariosInRadius = GetScenarioPointsInArea(posX, posY, posZ, radius, size)

-- always available, by hash
local retval, scenariosInRadius = Citizen.InvokeNative(0x345EC3B7EBDE1CB5, posX, posY, posZ, radius, Citizen.PointerValueInt(), size, Citizen.ResultAsInteger())
```

### JavaScript

```js
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#

```csharp
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

- [TASK::_RESET_SCENARIO_POINTS_IN_AREA](https://natives.borderlinerp.com/natives/TASK/_RESET_SCENARIO_POINTS_IN_AREA.md) — Resets/clears all scenario entities within the given spherical area

*Sources: alloc8or RDR3 NativeDB.*
