PedClient

getAnimInitialOffsetPosition

GET_ANIM_INITIAL_OFFSET_POSITION0xBE22B26DD764C040

The GTA V native GET_ANIM_INITIAL_OFFSET_POSITION of the PED namespace, as LS:MP client scripts call it: the global function getAnimInitialOffsetPosition, in JavaScript and in Lua.

SignatureJavaScript
getAnimInitialOffsetPosition(
  animDict: string,
  animName: string,
  x: number,
  y: number,
  z: number,
  xRot: number,
  yRot: number,
  zRot: number,
  p8: number,
  p9: number
): { x: number, y: number, z: number }
SignatureLua
getAnimInitialOffsetPosition(
  animDict: string,
  animName: string,
  x: number,
  y: number,
  z: number,
  xRot: number,
  yRot: number,
  zRot: number,
  p8: number,
  p9: integer
): Vector3

Usage

JavaScript
const coords = getAnimInitialOffsetPosition(
  animDict, animName, x, y, z, xRot, yRot, zRot, p8, p9
);
Lua
local coords = getAnimInitialOffsetPosition(
    animDict, animName, x, y, z, xRot, yRot, zRot, p8, p9
)
-- coords.x, coords.y, coords.z

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
const coords = getAnimInitialOffsetPosition(animDict, animName, pos, rot, p8, p9);
Lua · with vectors
local coords = getAnimInitialOffsetPosition(animDict, animName, pos, rot, p8, p9)

Parameters

ParameterTypeJavaScriptLua
animDictstringstringstring
animNamestringstringstring
xfloatnumbernumber
yfloatnumbernumber
zfloatnumbernumber
xRotfloatnumbernumber
yRotfloatnumbernumber
zRotfloatnumbernumber
p8floatnumbernumber
p9intnumberinteger

Returns

Vector3 JavaScript { x: number, y: number, z: number }, Lua Vector3

A 3D vector. JavaScript gets a plain { x, y, z } object; Lua gets a real Vector3, with .x .y .z and arithmetic. As an argument, one vector fills three consecutive coordinates.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Full list of animation dictionaries and anims by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/animDictsCompact.json

Reference

Namespace
Ped PED
In the game
Vector3 GET_ANIM_INITIAL_OFFSET_POSITION(const char* animDict, const char* animName, float x, float y, float z, float xRot, float yRot, float zRot, float p8, int p9)
Hash
0xBE22B26DD764C040

Open in the interactive natives reference