SET_ENTITY_COORDS
Sets the coordinates (world position) for a specified entity, offset by the radius of the entity on the Z axis.
Signature
void SET_ENTITY_COORDS(Entity entity, float xPos, float yPos, float zPos, BOOL alive, BOOL deadFlag, BOOL ragdollFlag, BOOL clearArea);Parameters
| Name | Type | Description |
|---|---|---|
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
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
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#
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);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. Write10.0orvalue + 0.0. The generated JS wrappers add0.0000001to non-zero floats for the same reason.
See also
GET_ENTITY_COORDSGets the current coordinates for a specified entity.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.