# POPULATION::_ADD_AMBIENT_SPAWN_RESTRICTION

- **Hash:** `0x18262CAFEBB5FBE1`
- **Namespace:** POPULATION
- **Runtime name (Lua/JS):** `AddAmbientSpawnRestriction`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/POPULATION/_ADD_AMBIENT_SPAWN_RESTRICTION

## Signature

```c
void _ADD_AMBIENT_SPAWN_RESTRICTION(Volume volume, int includeFlags, int excludeFlags, Hash p3, Hash p4, Hash p5, int p6);
```

## Parameters

- `volume` (`Volume`)
- `includeFlags` (`int`)
- `excludeFlags` (`int`)
- `p3` (`Hash`)
- `p4` (`Hash`)
- `p5` (`Hash`)
- `p6` (`int`)

## Returns

`void`

## Description

flags: see 0xB56D41A694E42E86

## Usage

### Lua

```lua
AddAmbientSpawnRestriction(volume, includeFlags, excludeFlags, p3, p4, p5, p6)

-- always available, by hash
Citizen.InvokeNative(0x18262CAFEBB5FBE1, volume, includeFlags, excludeFlags, p3, p4, p5, p6)
```

### JavaScript

```js
AddAmbientSpawnRestriction(volume, includeFlags, excludeFlags, p3, p4, p5, p6);

// by hash
Citizen.invokeNative('0x18262CAFEBB5FBE1', volume, includeFlags, excludeFlags, p3, p4, p5, p6);
```

### C#

```csharp
Function.Call((Hash)0x18262CAFEBB5FBE1, volume, includeFlags, excludeFlags, p3, p4, p5, p6);
```

- Hash parameters: the named function also accepts a string and hashes it for you; `Citizen.InvokeNative` needs the number — pass `joaat("name")` or a backtick literal like `` `name` ``.
- 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.

## Related enums

- [PedFilterFlags](https://natives.borderlinerp.com/enums/PedFilterFlags.md) — 31 values

## See also

- [POPULATION::_REMOVE_AMBIENT_SPAWN_RESTRICTION](https://natives.borderlinerp.com/natives/POPULATION/_REMOVE_AMBIENT_SPAWN_RESTRICTION.md)

*Sources: alloc8or RDR3 NativeDB.*
