DestroySound: Difference between revisions
From Onset Developer Wiki
Created page with "{{Info|Function|Client|1.0}} {{FuncDescription|__EDIT_ME__}} {{FuncSyntax|DestroySound(sound)}} {{FuncParameters}} {{FuncParam|sound|__EDIT_ME__}} {{FuncReturnValue|__EDIT..." |
No edit summary |
||
Line 1: | Line 1: | ||
{{Info|Function|Client|1.0}} | {{Info|Function|Client|1.0}} | ||
{{FuncDescription| | {{FuncDescription|Destroy the sound created with [[CreateSound]].}} | ||
{{FuncSyntax|DestroySound(sound)}} | {{FuncSyntax|DestroySound(sound)}} | ||
{{FuncParameters}} | {{FuncParameters}} | ||
{{FuncParam|sound| | {{FuncParam|sound|The sound identifier.}} | ||
{{FuncReturnValue| | {{FuncReturnValue|This function returs nothing.}} | ||
== Example == | == Example == | ||
<syntaxhighlight lang="Lua> | |||
function PlayAudioFile(file) | |||
DestroySound(LastSoundPlayed) | |||
LastSoundPlayed = CreateSound("client/files/"..file) | |||
SetSoundVolume(LastSoundPlayed, 1.1) | |||
end | |||
AddRemoteEvent("PlayAudioFile", PlayAudioFile) | |||
</syntaxhighlight> | |||
{{RelatedFunctions}} | {{RelatedFunctions}} | ||
{{Template:SoundFunctions}} |
Latest revision as of 12:54, 20 November 2019
Description
Destroy the sound created with CreateSound.
Syntax
DestroySound(sound)
Parameters
- sound
The sound identifier.
Return Value
- This function returs nothing.
Example
function PlayAudioFile(file)
DestroySound(LastSoundPlayed)
LastSoundPlayed = CreateSound("client/files/"..file)
SetSoundVolume(LastSoundPlayed, 1.1)
end
AddRemoteEvent("PlayAudioFile", PlayAudioFile)