RedM Natives

SET_ENTITY_COORDS

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

Hash0xDF70B41B
Runtime nameSetEntityCoords
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

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

Parameters

NameTypeDescription
entityEntity

The entity to change coordinates for.

xPosfloat

The X coordinate.

yPosfloat

The Y coordinate.

zPosfloat

The Z coordinate, ground level.

aliveBOOL

Unused by the game, potentially used by debug builds of GTA in order to assert whether or not an entity was alive.

deadFlagBOOL

Whether to disable physics for dead peds, too, and not just living peds.

ragdollFlagBOOL

A special flag used for ragdolling peds.

clearAreaBOOL

Whether to clear any entities in the target area.

Returns void

Description

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.

Usage

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

-- always works, by hash
Citizen.InvokeNative(0xdf70b41b, entity, xPos, yPos, zPos, alive, deadFlag, ragdollFlag, clearArea)
JavaScript and C#
JavaScript
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#
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

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.