# CFX::SET_ENTITY_ROTATION

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

## Signature

```c
void SET_ENTITY_ROTATION(Entity entity, float pitch, float roll, float yaw, int rotationOrder, BOOL bDeadCheck);
```

## Parameters

- `entity` (`Entity`) — The entity to rotate.
- `pitch` (`float`) — The pitch (X-axis) rotation in degrees.
- `roll` (`float`) — The roll (Y-axis) rotation in degrees.
- `yaw` (`float`) — The yaw (Z-axis) rotation in degrees.
- `rotationOrder` (`int`) — Specifies the order in which yaw, pitch, and roll are applied, see [`GET_ENTITY_ROTATION`](#\_0xAFBD61CC738D9EB9) for the available rotation orders.
- `bDeadCheck` (`BOOL`) — Usually set to `true`. Determines whether to check if the entity is dead before applying the rotation.

## Returns

`void`

## Description

*Source: Cfx.re native reference*

Sets the rotation of a specified entity in the game world.

```
NativeDB Introduced: v323
```

**This is the server-side RPC native equivalent of the client native [SET_ENTITY_ROTATION](?\_0x8524A8B0171D5E07).**

## Usage

### Lua

```lua
SetEntityRotation(entity, pitch, roll, yaw, rotationOrder, bDeadCheck)

-- always available, by hash
Citizen.InvokeNative(0xa345efe, entity, pitch, roll, yaw, rotationOrder, bDeadCheck)
```

### JavaScript

```js
SetEntityRotation(entity, pitch, roll, yaw, rotationOrder, bDeadCheck);

// by hash
Citizen.invokeNative('0xa345efe', entity, pitch + 0.0000001, roll + 0.0000001, yaw + 0.0000001, rotationOrder, bDeadCheck);
```

### C#

```csharp
Function.Call((Hash)0xa345efe, entity, pitch, roll, yaw, rotationOrder, bDeadCheck);
```

- Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.

## See also

- [CFX::GET_ENTITY_ROTATION](https://natives.borderlinerp.com/natives/CFX/GET_ENTITY_ROTATION.md)

*Sources: Cfx.re native reference.*
