<?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=Steady</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=Steady"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Steady"/>
	<updated>2026-04-29T21:23:08Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundMaxDistance&amp;diff=52058</id>
		<title>SetSoundMaxDistance</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundMaxDistance&amp;diff=52058"/>
		<updated>2017-08-22T01:31:00Z</updated>

		<summary type="html">&lt;p&gt;Steady: Changed the OOP syntax of the function to the setter instead of the getter.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Sets a custom [[sound]] max distance at which the sound stops.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundMaxDistance ( element sound, int distance )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:setMaxDistance|maxDistance|getSoundMaxDistance}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
*'''distance:''' the default value for this is 20&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the max distance was set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&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;
local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true)&lt;br /&gt;
&lt;br /&gt;
function maxdistanceFunc(command, param)&lt;br /&gt;
  setSoundMaxDistance(sound, tonumber(param))&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;setmaxdistance&amp;quot;, maxdistanceFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[ar:setSoundMaxDistance]]&lt;/div&gt;</summary>
		<author><name>Steady</name></author>
	</entry>
</feed>