# MISC::SET_RANDOM_EVENT_FLAG

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

## Signature

```c
void SET_RANDOM_EVENT_FLAG(BOOL toggle);
```

## Parameters

- `toggle` (`BOOL`)

## Returns

`void`

## Description

If the parameter is true, sets the random event flag to true, if the parameter is false, the function does nothing at all.
Does nothing if the mission flag is set.

## Usage

### Lua

```lua
SetRandomEventFlag(toggle)

-- always available, by hash
Citizen.InvokeNative(0xB1ADCCC4150C6473, toggle)
```

### JavaScript

```js
SetRandomEventFlag(toggle);

// by hash
Citizen.invokeNative('0xB1ADCCC4150C6473', toggle);
```

### C#

```csharp
Function.Call((Hash)0xB1ADCCC4150C6473, toggle);
```

## See also

- [MISC::GET_RANDOM_EVENT_FLAG](https://natives.borderlinerp.com/natives/MISC/GET_RANDOM_EVENT_FLAG.md)

*Sources: alloc8or RDR3 NativeDB.*
