# CFX::GET_ENTITY_TYPE

- **Hash:** `0xB1BD08D`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetEntityType`
- **Side:** server (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_ENTITY_TYPE

## Signature

```c
int GET_ENTITY_TYPE(Entity entity);
```

## Parameters

- `entity` (`Entity`) — The entity to get the type of.

## Returns

`int` — The entity type returned as an integer value.

## Description

*Source: Cfx.re native reference*

Gets the entity type (as an integer), which can be one of the following defined down below:

**The following entities will return type `1`:**

*   Ped
*   Player
*   Animal (Red Dead Redemption 2)
*   Horse (Red Dead Redemption 2)

**The following entities will return type `2`:**

*   Automobile
*   Bike
*   Boat
*   Heli
*   Plane
*   Submarine
*   Trailer
*   Train
*   DraftVeh (Red Dead Redemption 2)

**The following entities will return type `3`:**

*   Object
*   Door
*   Pickup

Otherwise, a value of `0` will be returned.

## Usage

### Lua

```lua
local retval = GetEntityType(entity)

-- always available, by hash
local retval = Citizen.InvokeNative(0xb1bd08d, entity, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetEntityType(entity);

// by hash
const retval = Citizen.invokeNative('0xb1bd08d', entity, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0xb1bd08d, entity);
```

*Sources: Cfx.re native reference.*
