EntityClient

getEntityAnimCurrentTime

GET_ENTITY_ANIM_CURRENT_TIME0x346D81500D088F42

The GTA V native GET_ENTITY_ANIM_CURRENT_TIME of the ENTITY namespace, as LS:MP client scripts call it: the global function getEntityAnimCurrentTime, in JavaScript and in Lua.

SignatureJavaScript
getEntityAnimCurrentTime(
  entity: Entity,
  animDict: string,
  animName: string
): number
SignatureLua
getEntityAnimCurrentTime(
  entity: Entity,
  animDict: string,
  animName: string
): number

Usage

JavaScript
const value = getEntityAnimCurrentTime(entity, animDict, animName);
Lua
local value = getEntityAnimCurrentTime(entity, animDict, animName)

Parameters

ParameterTypeJavaScriptLua
entityEntitynumberinteger
animDictstringstringstring
animNamestringstringstring

Returns

float JavaScript number, Lua number

Notes

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

Returns a float value representing animation's current playtime with respect to its total playtime. This value increasing in a range from [0 to 1] and wrap back to 0 when it reach 1.

Example:
0.000000 - mark the starting of animation.
0.500000 - mark the midpoint of the animation.
1.000000 - mark the end of animation.

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

Reference

Namespace
Entity ENTITY
In the game
float GET_ENTITY_ANIM_CURRENT_TIME(Entity entity, const char* animDict, const char* animName)
Hash
0x346D81500D088F42

Open in the interactive natives reference