RedM Natives

_SET_ENTITY_ROTATION_PARALLEL_TO_LINE

Sets the entity rotation so it is parallel to the direction defined by two world coordinates, without moving the entity.

Hash0xD45BB89B53FC0CFD
Runtime nameSetEntityRotationParallelToLine
NamespaceENTITY
SideClient
NameCommunity guess
Docs
Since build1207

Signature

void _SET_ENTITY_ROTATION_PARALLEL_TO_LINE(Entity entity, float x1, float y1, float z1, float x2, float y2, float z2, int p7);

Parameters

NameTypeDescription
entityEntity—
x1float—
y1float—
z1float—
x2float—
y2float—
z2float—
p7int—

Returns void

Description

alloc8or RDR3 NativeDB

Sets the entity rotation so it is parallel to the direction defined by two world coordinates, without moving the entity.
This does not make the entity face either coordinate directly; it aligns the entity with the line direction between the two points. Observed usage passes p7 = 1.

VORPCORE RDR3natives

Sets the entity's rotation so that it becomes parallel to the direction defined by the line between coords1 and coords2, without moving the entity from its current position.

This native does NOT make the entity face coords1 or coords2. Instead, it keeps the entity at its current world position and adjusts its orientation so that it is aligned parallel to the direction derived from the two coordinates

Usage

Lua
SetEntityRotationParallelToLine(entity, x1, y1, z1, x2, y2, z2, p7)

-- always works, by hash
Citizen.InvokeNative(0xD45BB89B53FC0CFD, entity, x1, y1, z1, x2, y2, z2, p7)
JavaScript and C#
JavaScript
SetEntityRotationParallelToLine(entity, x1, y1, z1, x2, y2, z2, p7);

// by hash
Citizen.invokeNative('0xD45BB89B53FC0CFD', entity, x1 + 0.0000001, y1 + 0.0000001, z1 + 0.0000001, x2 + 0.0000001, y2 + 0.0000001, z2 + 0.0000001, p7);
C#
Function.Call((Hash)0xD45BB89B53FC0CFD, entity, x1, y1, z1, x2, y2, z2, p7);
  • 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.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB · VORPCORE RDR3natives

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