<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Galaxy0439</id>
	<title>Multi Theft Auto: Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Galaxy0439"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Galaxy0439"/>
	<updated>2026-04-21T06:38:05Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77130</id>
		<title>StopSoundSlowly</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77130"/>
		<updated>2023-06-27T18:02:55Z</updated>

		<summary type="html">&lt;p&gt;Galaxy0439: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function stops the [[sound]] [[element]] slowly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int stopSoundSlowly( element sound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''sound''': The sound element that needs to be stopped.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' if the sound is not found.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stopSoundSlowly( sound_element )&lt;br /&gt;
     if not isElement( sound_element ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local sound_timer_quant = getSoundVolume( sound_element )&lt;br /&gt;
&lt;br /&gt;
    setTimer( function( )&lt;br /&gt;
        if isElement( sound_element ) then&lt;br /&gt;
            local sound_volume = getSoundVolume( sound_element )&lt;br /&gt;
            sound_volume = ( ( sound_volume * 10 ) - ( 0.1 * 10 ) ) / 10&lt;br /&gt;
            setSoundVolume( sound_element, sound_volume - 0.1 )&lt;br /&gt;
            if sound_volume &amp;lt;= 0.0 then&lt;br /&gt;
                stopSound( sound_element )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end, 500, sound_timer_quant * 10 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;stopS&amp;quot;,&lt;br /&gt;
    function (command,sound)&lt;br /&gt;
        stopSoundSlowly (sound)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: J.Chaikos, Galaxy0439&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Galaxy0439</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77129</id>
		<title>StopSoundSlowly</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77129"/>
		<updated>2023-06-27T17:47:03Z</updated>

		<summary type="html">&lt;p&gt;Galaxy0439: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function stops the [[sound]] [[element]] slowly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int stopSoundSlowly( element sound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''sound''': The sound element that needs to be stopped.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' if the sound is not found.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stopSoundSlowly( sound_element )&lt;br /&gt;
     if not isElement( sound_element ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local sound_timer_quant = getSoundVolume( sound_element )&lt;br /&gt;
&lt;br /&gt;
    setTimer( function( )&lt;br /&gt;
        local sound_volume = getSoundVolume( sound_element )&lt;br /&gt;
        setSoundVolume( sound_element, sound_volume - 0.1 )&lt;br /&gt;
        if sound_volume &amp;lt;= 0.1 then&lt;br /&gt;
            stopSound( sound_element )&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
    end, 500, sound_timer_quant * 10 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;stopS&amp;quot;,&lt;br /&gt;
    function (command,sound)&lt;br /&gt;
        stopSoundSlowly (sound)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: J.Chaikos, Galaxy0439&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Galaxy0439</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77128</id>
		<title>StopSoundSlowly</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77128"/>
		<updated>2023-06-27T17:45:02Z</updated>

		<summary type="html">&lt;p&gt;Galaxy0439: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function stops the [[sound]] [[element]] slowly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int stopSoundSlowly( element sound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''sound''': The sound element that needs to be stopped.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' if the sound is not found.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stopSoundSlowly( sound_element )&lt;br /&gt;
     if not isElement( sound_element ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local sound_timer_quant = getSoundVolume( sound_element )&lt;br /&gt;
&lt;br /&gt;
    setTimer( function( )&lt;br /&gt;
        local sound_volume = getSoundVolume( sound_element )&lt;br /&gt;
        setSoundVolume( sound_element, sound_volume - 0.1 )&lt;br /&gt;
        if sound_volume &amp;lt;= 0.1 then&lt;br /&gt;
            stopSound( sound_element )&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
    end, 500, sound_timer_quant * 10 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;stopS&amp;quot;,&lt;br /&gt;
    function (command,sound)&lt;br /&gt;
        stopSoundSlowly (sound)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: J.Chaikos&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Galaxy0439</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77127</id>
		<title>StopSoundSlowly</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77127"/>
		<updated>2023-06-27T17:24:36Z</updated>

		<summary type="html">&lt;p&gt;Galaxy0439: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function stops the [[sound]] [[element]] slowly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int stopSoundSlowly( element sound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''sound''': The sound element that needs to be stopped.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' if the sound is not found.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stopSoundSlowly( sound_element )&lt;br /&gt;
    if not isElement( sound_element ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local sound_timer_quant = getSoundVolume( sound_element )&lt;br /&gt;
&lt;br /&gt;
    setTimer( function( )&lt;br /&gt;
&lt;br /&gt;
        local sound_volume = getSoundVolume( sound_element )&lt;br /&gt;
        setSoundVolume( sound_element, sound_volume - 0.1 )&lt;br /&gt;
        if sound_volume &amp;lt;= 0.1 then&lt;br /&gt;
            stopSound( sound_element )&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
    end, 1000, sound_timer_quant * 10 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;stopS&amp;quot;,&lt;br /&gt;
    function (command,sound)&lt;br /&gt;
        stopSoundSlowly (sound)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: J.Chaikos&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Galaxy0439</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77126</id>
		<title>StopSoundSlowly</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77126"/>
		<updated>2023-06-27T16:58:07Z</updated>

		<summary type="html">&lt;p&gt;Galaxy0439: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function stops the [[sound]] [[element]] slowly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int stopSoundSlowly( element sound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''sound''': The sound element that needs to be stopped.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' if the sound is not found.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stopSoundSlowly( sound_element )&lt;br /&gt;
    if not isElement( sound_element ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local sound_timer_quant = getSoundVolume( sound_element )&lt;br /&gt;
&lt;br /&gt;
    local sound_timer = setTimer( function( )&lt;br /&gt;
        local sound_volume = getSoundVolume( sound_element )&lt;br /&gt;
        setSoundVolume( sound_element, sound_volume - 0.1 )&lt;br /&gt;
        if sound_volume &amp;lt;= 0.0 then&lt;br /&gt;
            stopSound( sound_element )&lt;br /&gt;
        end&lt;br /&gt;
    end, 1000, sound_timer_quant * 10 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;stopS&amp;quot;,&lt;br /&gt;
    function (command,sound)&lt;br /&gt;
        stopSoundSlowly (sound)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: J.Chaikos&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Galaxy0439</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77125</id>
		<title>StopSoundSlowly</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77125"/>
		<updated>2023-06-27T16:57:30Z</updated>

		<summary type="html">&lt;p&gt;Galaxy0439: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function stops the [[sound]] [[element]] slowly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int stopSoundSlowly( element sound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''sound''': The sound element that needs to be stopped.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' if the sound is not found.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stopSoundSlowly( sound_element )&lt;br /&gt;
    if not isElement( sound_element ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local sound_timer_quant = getSoundVolume( sound_element )&lt;br /&gt;
&lt;br /&gt;
    local sound_timer = setTimer( function( )&lt;br /&gt;
        local sound_volume = getSoundVolume( sound_element )&lt;br /&gt;
        setSoundVolume( sound_element, sound_volume - 0.1 )&lt;br /&gt;
        if sound_volume &amp;lt;= 0.0 then&lt;br /&gt;
            stopSound( sound_element )&lt;br /&gt;
            if isTimer( sound_timer ) then&lt;br /&gt;
                killTimer( sound_timer )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end, 1000, sound_timer_quant * 10 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;stopS&amp;quot;,&lt;br /&gt;
    function (command,sound)&lt;br /&gt;
        stopSoundSlowly (sound)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: J.Chaikos&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Galaxy0439</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77124</id>
		<title>StopSoundSlowly</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77124"/>
		<updated>2023-06-27T16:54:18Z</updated>

		<summary type="html">&lt;p&gt;Galaxy0439: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function stops the [[sound]] [[element]] slowly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int stopSoundSlowly( element sound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''sound''': The sound element that needs to be stopped.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' if the sound is not found.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function stopSoundSlowly( sound_element )&lt;br /&gt;
    if not isElement( sound_element ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local sound_timer_quant = getSoundVolume( sound_element )&lt;br /&gt;
&lt;br /&gt;
    local sound_timer = setTimer( function( )&lt;br /&gt;
        local sound_volume = getSoundVolume( sound_element )&lt;br /&gt;
        setSoundVolume( sound_element, sound_volume - 0.1 )&lt;br /&gt;
        if sound_volume &amp;lt;= 0.0 then&lt;br /&gt;
            stopSound( sound_element )&lt;br /&gt;
            if isTimer( sound_timer ) then&lt;br /&gt;
                destroyElement( sound_timer )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end, 1000, sound_timer_quant * 10 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;stopS&amp;quot;,&lt;br /&gt;
    function (command,sound)&lt;br /&gt;
        stopSoundSlowly (sound)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: J.Chaikos&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Galaxy0439</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77123</id>
		<title>StopSoundSlowly</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=StopSoundSlowly&amp;diff=77123"/>
		<updated>2023-06-27T16:50:34Z</updated>

		<summary type="html">&lt;p&gt;Galaxy0439: /* Code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
&amp;lt;lowercasetitle&amp;gt;&amp;lt;/lowercasetitle&amp;gt;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function stops the [[sound]] [[element]] slowly.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int stopSoundSlowly( element sound )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''sound''': The sound element that needs to be stopped.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the sound was successfully stopped, ''false'' if the sound is not found.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function StopSoundSlowly( sound_element )&lt;br /&gt;
    if not isElement( sound_element ) then return false end&lt;br /&gt;
&lt;br /&gt;
    local sound_timer_quant = getSoundVolume( sound_element )&lt;br /&gt;
&lt;br /&gt;
    local sound_timer = setTimer( function( )&lt;br /&gt;
        local sound_volume = getSoundVolume( sound_element )&lt;br /&gt;
        setSoundVolume( sound_element, sound_volume - 0.1 )&lt;br /&gt;
        if sound_volume &amp;lt;= 0.0 then&lt;br /&gt;
            stopSound( sound_element )&lt;br /&gt;
            if isTimer( sound_timer ) then&lt;br /&gt;
                destroyElement( sound_timer )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end, 1000, sound_timer_quant * 10 )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Clientside Script&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;stopS&amp;quot;,&lt;br /&gt;
    function (command,sound)&lt;br /&gt;
        stopSoundSlowly (sound)&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: J.Chaikos&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Galaxy0439</name></author>
	</entry>
</feed>