HU/isSoundPaused: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 16: Line 16:


==Példa==  
==Példa==  
This example will check and see if the sound is paused or not, and tell the player.
Ez a példa ellenőrizni fogja, hogy a hang szüneteltetve van-e, vagy sem, és tájékoztatja erről a játékost.
<section name="Client" class="client" show="true">
<section name="Client" class="client" show="true">
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">

Revision as of 20:22, 19 July 2018

Ez a funkció a megadott hangelem jelenlegi szünetállapotának visszaadására szolgál.

Ha az elem egy játékos, akkor ez a funkció a játékos hangját fogja használni.

Szintaxis

bool isSoundPaused ( element theSound )

OOP Syntax Help! I don't understand this!

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


Kötelező argumentumok

  • theSound: the sound element which pause state you want to return.

Visszaadott érték

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

Példa

Ez a példa ellenőrizni fogja, hogy a hang szüneteltetve van-e, vagy sem, és tájékoztatja erről a játékost.

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