isSoundPaused | Multi Theft Auto: Wiki Skip to content

isSoundPaused

Client-side
Server-side
Shared

Pair: setSoundPaused

This function is used to return the current pause state of the specified sound element.

If the element is a player, this function will use the players voice.

OOP Syntax Help! I don't understand this!

  • Method: theSound:isPaused(...)
  • Variable: .paused

Syntax

bool isSoundPaused ( sound/player theSound )
Required Arguments
  • theSound: The sound element which pause state you want to return.

Returns

  • bool: result

Returns true if the sound element is paused, false if unpaused or invalid arguments were passed.

Code Examples

client

This example will check and see if the sound is paused or not, and tell the player.

local theSound = playSound("music/song.mp3")
function checkSongPause()
local pause = isSoundPaused(theSound)
if(pause) then
outputChatBox("The sound is paused!")
else
outputChatBox("The sound is not paused!")
end
end
addCommandHandler("checkpause", checkSongPause)

Changelog

  • 1.3.2Added player element to use a players voice.