# CFX::SET_ENTITY_COORDS

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

## Signature

```c
void SET_ENTITY_COORDS(Entity entity, float xPos, float yPos, float zPos, BOOL alive, BOOL deadFlag, BOOL ragdollFlag, BOOL clearArea);
```

## Parameters

- `entity` (`Entity`) — The entity to change coordinates for.
- `xPos` (`float`) — The X coordinate.
- `yPos` (`float`) — The Y coordinate.
- `zPos` (`float`) — The Z coordinate, ground level.
- `alive` (`BOOL`) — Unused by the game, potentially used by debug builds of GTA in order to assert whether or not an entity was alive.
- `deadFlag` (`BOOL`) — Whether to disable physics for dead peds, too, and not just living peds.
- `ragdollFlag` (`BOOL`) — A special flag used for ragdolling peds.
- `clearArea` (`BOOL`) — Whether to clear any entities in the target area.

## Returns

`void`

## Description

*Source: Cfx.re native reference*

Sets the coordinates (world position) for a specified entity, offset by the radius of the entity on the Z axis.

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

## Usage

### Lua

```lua
SetEntityCoords(entity, xPos, yPos, zPos, alive, deadFlag, ragdollFlag, clearArea)

-- always available, by hash
Citizen.InvokeNative(0xdf70b41b, entity, xPos, yPos, zPos, alive, deadFlag, ragdollFlag, clearArea)
```

### JavaScript

```js
SetEntityCoords(entity, xPos, yPos, zPos, alive, deadFlag, ragdollFlag, clearArea);

// by hash
Citizen.invokeNative('0xdf70b41b', entity, xPos + 0.0000001, yPos + 0.0000001, zPos + 0.0000001, alive, deadFlag, ragdollFlag, clearArea);
```

### C#

```csharp
Function.Call((Hash)0xdf70b41b, entity, xPos, yPos, zPos, alive, deadFlag, ragdollFlag, clearArea);
```

- 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_COORDS](https://natives.borderlinerp.com/natives/CFX/GET_ENTITY_COORDS.md) — Gets the current coordinates for a specified entity.

*Sources: Cfx.re native reference.*
