# EVENT::_EVENT_GET_TARGET_ENTITY_FROM_EVENT

- **Hash:** `0x38497F139981C5C9`
- **Namespace:** EVENT
- **Runtime name (Lua/JS):** `EventGetTargetEntityFromEvent`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/EVENT/_EVENT_GET_TARGET_ENTITY_FROM_EVENT

## Signature

```c
Entity _EVENT_GET_TARGET_ENTITY_FROM_EVENT(Entity entity, Hash eventType, int p2, int p3);
```

## Parameters

- `entity` (`Entity`)
- `eventType` (`Hash`)
- `p2` (`int`)
- `p3` (`int`)

## Returns

`Entity`

## Usage

### Lua

```lua
local retval = EventGetTargetEntityFromEvent(entity, eventType, p2, p3)

-- always available, by hash
local retval = Citizen.InvokeNative(0x38497F139981C5C9, entity, eventType, p2, p3, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = EventGetTargetEntityFromEvent(entity, eventType, p2, p3);

// by hash
const retval = Citizen.invokeNative('0x38497F139981C5C9', entity, eventType, p2, p3, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x38497F139981C5C9, entity, eventType, p2, p3);
```

- 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

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

*Sources: alloc8or RDR3 NativeDB.*
