IsSoundPaused: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 10: Line 10:
{{OOP||[[sound]]:isPaused|paused|setSoundPaused}}
{{OOP||[[sound]]:isPaused|paused|setSoundPaused}}
===Required Arguments===  
===Required Arguments===  
*'''theSound:''' the [[sound]] [[element]] which pause state you want to return.
*'''theSound:''' the [[sound]] [[element]] которого вы хотите вернуть.


===Returns===
===Returns===

Revision as of 14:38, 29 October 2016

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.

Syntax

bool isSoundPaused ( element theSound )

OOP Syntax Help! I don't understand this!

Method: sound:isPaused(...)
Variable: .paused
Counterpart: setSoundPaused


Required Arguments

  • theSound: the sound element которого вы хотите вернуть.

Returns

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

Example

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

Click to collapse [-]
Client
theSound = playSound("music/song.mp3")
function checkSongPause()
    local pause = isSoundPaused(theSound)
    if(pause == true) then
        outputChatBox("The sound is paused!")
    else
        outputChatBox("The sound is not paused!")
    end
end
addCommandHandler("checkpause", checkSongPause)

Changelog

Version Description
1.3.2 Added player element to use a players voice

See Also