RedM Natives

GET_OFFSET_FROM_COORD_AND_HEADING_IN_WORLD_COORDS

Old name: _GET_OBJECT_OFFSET_FROM_COORDS

Hash0x163E252DE035A133
Runtime nameGetOffsetFromCoordAndHeadingInWorldCoords
NamespaceOBJECT
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x163E252DE035A133

Signature

Vector3 GET_OFFSET_FROM_COORD_AND_HEADING_IN_WORLD_COORDS(float xPos, float yPos, float zPos, float heading, float xOffset, float yOffset, float zOffset);

Parameters

NameTypeDescription
xPosfloat—
yPosfloat—
zPosfloat—
headingfloat—
xOffsetfloat—
yOffsetfloat—
zOffsetfloat—

Returns Vector3

Description

Old name: _GET_OBJECT_OFFSET_FROM_COORDS

Usage

Lua
local retval = GetOffsetFromCoordAndHeadingInWorldCoords(xPos, yPos, zPos, heading, xOffset, yOffset, zOffset)

-- always works, by hash
local retval = Citizen.InvokeNative(0x163E252DE035A133, xPos, yPos, zPos, heading, xOffset, yOffset, zOffset, Citizen.ResultAsVector())
JavaScript and C#
JavaScript
const retval = GetOffsetFromCoordAndHeadingInWorldCoords(xPos, yPos, zPos, heading, xOffset, yOffset, zOffset);

// by hash
const retval = Citizen.invokeNative('0x163E252DE035A133', xPos + 0.0000001, yPos + 0.0000001, zPos + 0.0000001, heading + 0.0000001, xOffset + 0.0000001, yOffset + 0.0000001, zOffset + 0.0000001, Citizen.returnResultAnyway(), Citizen.resultAsVector());
C#
Vector3 retval = Function.Call<Vector3>((Hash)0x163E252DE035A133, xPos, yPos, zPos, heading, xOffset, yOffset, zOffset);
  • 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.

Sources

alloc8or RDR3 NativeDB

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