|
|
(One intermediate revision by one other user not shown) |
Line 1: |
Line 1: |
− | ==getSoundId==
| + | #REDIRECT [[Global Command: getSoundId]] |
− | | |
− | <div class="command-min-version-info">Available since: <span class="command-min-version">v3.8</span></div>
| |
− | | |
− | <div class="command-doc">Gets the sound ID of the specified sound if it is currently active.</div>
| |
− | | |
− | Lua Syntax:
| |
− | <pre class="command-syntax">getSoundId(sounditem)</pre>
| |
− | ===Arguments===
| |
− | ====sounditem====
| |
− | :'''"string" (string should contain 'vispath:' prefix)''' - Relative filename of sound.
| |
− | ===Flags===
| |
− | ===Return Values===
| |
− | ;soundID
| |
− | :Unique id referencing the requested sound or -1 if the sound is not active.
| |
− | ===Examples===
| |
− | Example 1:
| |
− | <syntaxhighlight>
| |
− | -- store sound id of a currently active sound in a local variable
| |
− | local soundID = getSoundId('vispath:sounds/example.ogg')
| |
− | </syntaxhighlight>
| |
− | [[Category:Player Commands]] | |