ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Client functions
  3. getSoundPosition

Function

getSoundPosition

ClientSound (client)Identical to MTA:SA

Returns the current playback position in seconds.

Syntax

float getSoundPosition(sound theSound)

Arguments

theSoundsound
The sound.

Returns

The second or false.

Example

addEventHandler("onClientRender", root, function()
    if isElement(music) then
        dxDrawText(("%.0f / %.0f s"):format(getSoundPosition(music), getSoundLength(music)), 20, 320)
    end
end)

See also