# SCRIPT::GET_EVENT_AT_INDEX

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

## Signature

```c
Hash GET_EVENT_AT_INDEX(int eventGroup, int eventIndex);
```

## Parameters

- `eventGroup` (`int`)
- `eventIndex` (`int`)

## Returns

`Hash`

## Description

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors)

Returns event name hash: https://alloc8or.re/rdr3/doc/enums/eEventType.txt

## Usage

### Lua

```lua
local retval = GetEventAtIndex(eventGroup, eventIndex)

-- always available, by hash
local retval = Citizen.InvokeNative(0xA85E614430EFF816, eventGroup, eventIndex, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetEventAtIndex(eventGroup, eventIndex);

// by hash
const retval = Citizen.invokeNative('0xA85E614430EFF816', eventGroup, eventIndex, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0xA85E614430EFF816, eventGroup, eventIndex);
```

## Related enums

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

*Sources: alloc8or RDR3 NativeDB.*
