getCinematicPosition
Client
Returns which cinematic time the playback is at.
int|false getCinematicPosition(cinematic cinematic)
Parameters
| Name | Type | Description |
|---|---|---|
| cinematic | cinematic | The cinematic. |
Returns
The time in ms, or false if nothing of the cinematic is playing.
Example
local intro = createCinematic("cinematics/intro.cine")
playCinematic(intro)
addEventHandler("onClientRender", root, function()
local now = getCinematicPosition(intro)
local length = getCinematicDuration(intro)
if now and length > 0 then
dxDrawRectangle(0, 0, 400 * now / length, 4, tocolor(255, 255, 255))
end
end)