IsSoundPaused: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Reversed (This is English section of wiki...))
Line 1: Line 1:
__NOTOC__  
__NOTOC__  
{{Client function}}
{{Client function}}
Это функция используется для отображения статуса выбранного [[звукового элемента]].
This function is used to return the current pause state of the specified [[sound]] [[element]].


{{New feature/item|3.0132|1.3.2||
{{New feature/item|3.0132|1.3.2||
Если элемент это [[игрок]], функция использует звук с микрофона игрока.
If the element is a [[player]], this function will use the players voice.
}}
}}
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">bool isSoundPaused ( звуковой элемент )</syntaxhighlight>  
<syntaxhighlight lang="lua">bool isSoundPaused ( element theSound )</syntaxhighlight>  
{{OOP||[[sound]]:isPaused|paused|setSoundPaused}}
{{OOP||[[sound]]:isPaused|paused|setSoundPaused}}
===Required Arguments===  
===Required Arguments===  
*'''theSound:''' Звуковой элемент, статус которого вы хотите вернуть.
*'''theSound:''' the [[sound]] [[element]] which pause state you want to return.


===Returns===
===Returns===
Ответ будет ''true'' если указанный звуковой элемент на паузе, ''false'' если звуковой элемент снят с паузы,или не найден.
Returns ''true'' if the [[sound]] [[element]] is paused, ''false'' if unpaused or invalid arguments were passed.


==Example==  
==Example==  
Этот пример проверит стоит ли звуковой элемент на паузе или нет, и отобразит ответ игроку.
This example will check and see if the sound is paused or not, and tell the player.
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
Line 23: Line 23:
     local pause = isSoundPaused(theSound)
     local pause = isSoundPaused(theSound)
     if(pause == true) then
     if(pause == true) then
         outputChatBox("Звуковой элемент на паузе!")
         outputChatBox("The sound is paused!")
     else
     else
         outputChatBox("Звуковой элемент не на паузе!")
         outputChatBox("The sound is not paused!")
     end
     end
end
end
Line 34: Line 34:
==Changelog==
==Changelog==
{{ChangelogHeader}}
{{ChangelogHeader}}
{{ChangelogItem|1.3.2|Добавлено использование звука с микрофона игрока}
{{ChangelogItem|1.3.2|Added player element to use a players voice}}


==See Also==
==See Also==

Revision as of 00:20, 30 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 which pause state you want to return.

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