getPedAnimationProgress
Client
Tells how far along the animation the ped is playing is, such as one from setPedAnimation.
float getPedAnimationProgress(ped ped)
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player. |
Returns
A number from 0 (start) to 1 (end), or -1 if the ped plays no named animation or is streamed out.
Example
addEventHandler("onClientRender", root, function()
local progress = getPedAnimationProgress(localPlayer)
if progress >= 0 then
dxDrawText(("%d%%"):format(progress * 100), 20, 300)
end
end)