<?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=SDraw</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=SDraw"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/SDraw"/>
	<updated>2026-04-28T17:05:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=67086</id>
		<title>GetSoundLevelData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=67086"/>
		<updated>2020-07-25T07:37:21Z</updated>

		<summary type="html">&lt;p&gt;SDraw: Undo revision 67085 by SDraw (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the left/right level from a [[sound]] [[element]].&lt;br /&gt;
{{New feature/item|3.0132|1.3.2||&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int, int getSoundLevelData ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getLevelData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' the [[sound]] [[element]] which level data you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a two ''integers'' in range from 0 to 32768.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local leftData, rightData = getSoundLevelData ( soundHandler )&lt;br /&gt;
	if ( leftData ) then&lt;br /&gt;
            dxDrawRectangle ( 0, 0, 64, leftData / 32768 * 256, tocolor ( 255, 0, 0 ) )&lt;br /&gt;
            dxDrawRectangle ( 64, 0, 64, rightData / 32768 * 256, tocolor ( 0, 0, 255 ) )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root, onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:getSoundLevelData]]&lt;br /&gt;
[[ar:getSoundLevelData]]&lt;br /&gt;
[[ro:getSoundLevelData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=67085</id>
		<title>GetSoundLevelData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=67085"/>
		<updated>2020-07-25T07:10:26Z</updated>

		<summary type="html">&lt;p&gt;SDraw: 2^15 possible values (first value - 0, last value - 32767)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the left/right level from a [[sound]] [[element]].&lt;br /&gt;
{{New feature/item|3.0132|1.3.2||&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int, int getSoundLevelData ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getLevelData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' the [[sound]] [[element]] which level data you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a two ''integers'' in range from 0 to 32767.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local leftData, rightData = getSoundLevelData ( soundHandler )&lt;br /&gt;
	if ( leftData ) then&lt;br /&gt;
            dxDrawRectangle ( 0, 0, 64, leftData / 32767 * 256, tocolor ( 255, 0, 0 ) )&lt;br /&gt;
            dxDrawRectangle ( 64, 0, 64, rightData / 32767 * 256, tocolor ( 0, 0, 255 ) )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root, onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:getSoundLevelData]]&lt;br /&gt;
[[ar:getSoundLevelData]]&lt;br /&gt;
[[ro:getSoundLevelData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=55818</id>
		<title>GetSoundWaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=55818"/>
		<updated>2018-07-10T18:50:56Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the wave form data for an audio stream which is a table of floats representing the current audio frame as a wave.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0132|1.3.2||&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundWaveData ( element sound, int iSamples )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getWaveData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] [[element]] that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] of '''iSamples''' ''floats'' representing the current audio frame waveform.&lt;br /&gt;
Returns ''false'' if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local waveData = getSoundWaveData ( soundHandler, 256 )&lt;br /&gt;
	if ( waveData ) then&lt;br /&gt;
            for i=0,255 do&lt;br /&gt;
                dxDrawRectangle ( i, 128, 1, waveData[i] * 128)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[ar:getSoundWaveData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55816</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55816"/>
		<updated>2018-07-10T18:26:09Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getFFTData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 (or '''iBands''' if '''iBands''' is used) ''floats'' representing the current audio frame.&lt;br /&gt;
Returns ''false'' if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local soundFFT = getSoundFFTData ( soundHandler, 2048, 256 )&lt;br /&gt;
	if ( soundFFT ) then&lt;br /&gt;
            for i = 0, 255 do -- Data starts from index 0&lt;br /&gt;
                dxDrawRectangle ( i, 0, 1, math.sqrt ( soundFFT[i] ) * 256 )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[ES:getSoundFFTData]]&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=55815</id>
		<title>GetSoundWaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=55815"/>
		<updated>2018-07-10T18:22:44Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the wave form data for an audio stream which is a table of floats representing the current audio frame as a wave.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0132|1.3.2||&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundWaveData ( element sound, int iSamples )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getWaveData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] [[element]] that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] of '''iSamples''' ''floats'' representing the current audio frame waveform.&lt;br /&gt;
Returns ''false'' if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local waveData = getSoundWaveData ( soundHandler, 256 )&lt;br /&gt;
	if ( waveData ) then&lt;br /&gt;
            for i=0,255 do&lt;br /&gt;
                dxDrawRectangle ( i, 128, 1, waveData[i] * 256)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[ar:getSoundWaveData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=55813</id>
		<title>GetSoundWaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=55813"/>
		<updated>2018-07-10T18:02:22Z</updated>

		<summary type="html">&lt;p&gt;SDraw: More senseble example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the wave form data for an audio stream which is a table of floats representing the current audio frame as a wave.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0132|1.3.2||&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundWaveData ( element sound, int iSamples )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getWaveData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] [[element]] that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] of '''iSamples'''/2 ''floats'' representing the current audio frame waveform.&lt;br /&gt;
Returns ''false'' if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local waveData = getSoundWaveData ( soundHandler, 256 )&lt;br /&gt;
	if ( waveData ) then&lt;br /&gt;
            for i=0,255 do&lt;br /&gt;
                dxDrawRectangle ( i, 128, 1, waveData[i] * 256)&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[ar:getSoundWaveData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=55812</id>
		<title>GetSoundLevelData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=55812"/>
		<updated>2018-07-10T17:47:39Z</updated>

		<summary type="html">&lt;p&gt;SDraw: More sensible example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the left/right level from a [[sound]] [[element]].&lt;br /&gt;
{{New feature/item|3.0132|1.3.2||&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int, int getSoundLevelData ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getLevelData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' the [[sound]] [[element]] which level data you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a two ''integers'' in range from 0 to 32767.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local leftData, rightData = getSoundLevelData ( soundHandler )&lt;br /&gt;
	if ( leftData ) then&lt;br /&gt;
            dxDrawRectangle ( 0, 0, 64, leftData / 32767 * 256, tocolor ( 255, 0, 0 ) )&lt;br /&gt;
            dxDrawRectangle ( 64, 0, 64, rightData / 32767 * 256, tocolor ( 0, 0, 255 ) )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[ar:getSoundLevelData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55811</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55811"/>
		<updated>2018-07-10T17:46:24Z</updated>

		<summary type="html">&lt;p&gt;SDraw: Function returns iBands floats with start index 0.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getFFTData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 (or '''iBands''' if '''iBands''' is used) ''floats'' representing the current audio frame.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local soundFFT = getSoundFFTData ( soundHandler, 2048, 256 )&lt;br /&gt;
	if ( soundFFT ) then&lt;br /&gt;
            for i = 0, 255 do -- Data starts from index 0&lt;br /&gt;
                dxDrawRectangle ( i, 0, 1, math.sqrt ( soundFFT[i] ) * 256 )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[ES:getSoundFFTData]]&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55810</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55810"/>
		<updated>2018-07-10T17:30:47Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getFFTData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 (or '''iBands'''-1 if '''iBands''' is used) floats representing the current audio frame.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local soundFFT = getSoundFFTData ( soundHandler, 2048, 256 )&lt;br /&gt;
	if ( soundFFT ) then&lt;br /&gt;
            for i = 0, 255 do -- Data starts from index 0&lt;br /&gt;
                dxDrawRectangle ( i, 0, 1, math.sqrt ( soundFFT[i] ) * 256 )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[ES:getSoundFFTData]]&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55808</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55808"/>
		<updated>2018-07-09T20:36:40Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the fast fourier transform data for an audio stream which is a table of floats representing the current audio frame.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
a fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
&lt;br /&gt;
Should you have any problems there is an example resource located on the resource svn here:&lt;br /&gt;
[https://code.google.com/p/mtasa-resources/source/browse/#svn%2Ftrunk%2F%5Bgameplay%5D%2FVisualiser Visualiser]&lt;br /&gt;
&lt;br /&gt;
just type &amp;quot;startmusic mystreamurl&amp;quot; in your console and it will play on the cinema billboard near A51&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getFFTData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 (or '''iBands''' if '''iBands''' is used) floats representing the current audio frame.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local soundFFT = getSoundFFTData ( soundHandler, 2048, 256 )&lt;br /&gt;
	if ( soundFFT ) then&lt;br /&gt;
            for i = 0, 255 do -- Data starts from index 0&lt;br /&gt;
                dxDrawRectangle ( 0, i, 1, math.sqrt ( soundFFT[i] ) * 256 )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[ES:getSoundFFTData]]&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55807</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55807"/>
		<updated>2018-07-09T20:30:45Z</updated>

		<summary type="html">&lt;p&gt;SDraw: Right FFT data range&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the fast fourier transform data for an audio stream which is a table of floats representing the current audio frame.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
a fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
&lt;br /&gt;
Should you have any problems there is an example resource located on the resource svn here:&lt;br /&gt;
[https://code.google.com/p/mtasa-resources/source/browse/#svn%2Ftrunk%2F%5Bgameplay%5D%2FVisualiser Visualiser]&lt;br /&gt;
&lt;br /&gt;
just type &amp;quot;startmusic mystreamurl&amp;quot; in your console and it will play on the cinema billboard near A51&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getFFTData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 (or '''iBands'''-1 if '''iBands''' is used) floats representing the current audio frame.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local soundFFT = getSoundFFTData ( soundHandler, 2048, 257 )&lt;br /&gt;
	if ( soundFFT ) then&lt;br /&gt;
            for i = 0, 255 do&lt;br /&gt;
                dxDrawRectangle ( 0, i, 1, math.sqrt ( soundFFT[i] ) * 256 )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[ES:getSoundFFTData]]&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55805</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=55805"/>
		<updated>2018-07-09T20:22:22Z</updated>

		<summary type="html">&lt;p&gt;SDraw: More sensible example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the fast fourier transform data for an audio stream which is a table of floats representing the current audio frame.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
a fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
&lt;br /&gt;
Should you have any problems there is an example resource located on the resource svn here:&lt;br /&gt;
[https://code.google.com/p/mtasa-resources/source/browse/#svn%2Ftrunk%2F%5Bgameplay%5D%2FVisualiser Visualiser]&lt;br /&gt;
&lt;br /&gt;
just type &amp;quot;startmusic mystreamurl&amp;quot; in your console and it will play on the cinema billboard near A51&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[sound]]:getFFTData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 (or '''iBands'''-1 if '''iBands''' is used) floats representing the current audio frame.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&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;
soundHandler = playSound ( &amp;quot;sound.wav&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
function onSoundPlayRender ( )&lt;br /&gt;
    if ( soundHandler ) then&lt;br /&gt;
        local soundFFT = getSoundFFTData ( soundHandler, 2048, 257 )&lt;br /&gt;
	if ( soundFFT ) then&lt;br /&gt;
            for i = 1, 256 do&lt;br /&gt;
                dxDrawRectangle ( 0, i - 1, 1, math.sqrt ( soundFFT[i] ) * 256 )&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, getRootElement(), onSoundPlayRender )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[ES:getSoundFFTData]]&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=51110</id>
		<title>SetVehicleComponentVisible</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=51110"/>
		<updated>2017-05-29T17:36:33Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0131|1.3.1|4715|&lt;br /&gt;
This function sets component visibility for [[vehicle]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleComponentVisible ( vehicle theVehicle, string theComponent, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:setComponentVisible||getVehicleComponentVisible}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to set component visibility of.&lt;br /&gt;
*'''theComponent:''' A [[Vehicle_Components|vehicle component]] (this is the frame name from the model file of the component you wish to modify)&lt;br /&gt;
*'''visible:''' a ''bool'' which determines if the component should be visible&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
Returns a ''bool'' indicating if the visiblity was changed successfully.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example hide all components when you enter a vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function()&lt;br /&gt;
        local getComponent = getVehicleComponents(source) -- get a table with all the components of the vehicle&lt;br /&gt;
        for k in pairs (getComponent) do&lt;br /&gt;
            setVehicleComponentVisible(source, k, false) -- hides the component&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=51109</id>
		<title>SetVehicleComponentVisible</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleComponentVisible&amp;diff=51109"/>
		<updated>2017-05-29T17:36:07Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0131|1.3.1|4715|&lt;br /&gt;
This function sets component visibility for [[vehicle]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleComponentVisible ( vehicle theVehicle, string theComponent, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:setComponentVisible||getVehicleComponentVisible}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] you wish to set component visibility of.&lt;br /&gt;
*'''theComponent:''' A [[Vehicle_Components|vehicle component]] (this is the frame name from the model file of the component you wish to modify)&lt;br /&gt;
*'''visible:''' a ''bool'' which determines if the component should be visible&lt;br /&gt;
&lt;br /&gt;
===Returns=== &lt;br /&gt;
Returns a ''bool'' indicating if the visiblity was changed succesfully.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example hide all components when you enter a vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientVehicleEnter&amp;quot;, getRootElement(),&lt;br /&gt;
    function()&lt;br /&gt;
        local getComponent = getVehicleComponents(source) -- get a table with all the components of the vehicle&lt;br /&gt;
        for k in pairs (getComponent) do&lt;br /&gt;
            setVehicleComponentVisible(source, k, false) -- hides the component&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiCreateEdit&amp;diff=50905</id>
		<title>GuiCreateEdit</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiCreateEdit&amp;diff=50905"/>
		<updated>2017-05-09T19:52:58Z</updated>

		<summary type="html">&lt;p&gt;SDraw: Added OOP syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
[[Image:Gui-edit.png|frame|Example GUI edit field.]]&lt;br /&gt;
&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=80&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function is for creating a new GUI edit box.  This is a text box in which the user can input text. Edit boxes only allow a single line of text. If you want to allow multiple lines of text create a memo box using [[guiCreateMemo]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element guiCreateEdit ( float x, float y, float width, float height, string text, bool relative, [element parent = nil] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Element/GUI/Edit_field|GuiEdit]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''x:''' A float of the 2D x position of the GUI edit box on a player's screen.  This is affected by the ''relative'' argument.&lt;br /&gt;
*'''y:''' A float of the 2D y position of the GUI edit box on a player's screen. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''width:''' A float of the width of the GUI edit box. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''height:''' A float of the height of the GUI edit box. This is affected by the ''relative'' argument.&lt;br /&gt;
*'''text:''' A string of the text that will be displayed by default in the edit box.&lt;br /&gt;
*'''relative:''' This is whether sizes and positioning are relative.  If this is ''true'', then all x,y,width,height floats must be between 0 and 1, representing measures relative to the parent.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''parent:''' This is the parent that the GUI edit box is attached to.  If the ''relative'' argument is true, sizes and positioning will be made relative to this parent. If the ''relative'' argument is false, positioning will be the number of offset pixels from the parent's origin. If no parent is passed, the parent will become the screen - causing positioning and sizing according to screen positioning.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a gui-edit element of the created edit box if it was successfully created, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an edit box alongside an &amp;quot;Output!&amp;quot; button.  When the button is clicked, it will output the message in the edit box into the Chat Box.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--create our button&lt;br /&gt;
button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, &amp;quot;OK&amp;quot;, true )&lt;br /&gt;
--Create an edit box and define it as &amp;quot;editBox&amp;quot;.&lt;br /&gt;
editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, &amp;quot;&amp;quot;, true )&lt;br /&gt;
guiEditSetMaxLength ( editBox, 128 ) --the max chatbox length is 128, so force this&lt;br /&gt;
&lt;br /&gt;
--setup our function to output the message to the chatbox&lt;br /&gt;
function outputEditBox ()&lt;br /&gt;
        local text = guiGetText ( editBox )--get the text from the edit box&lt;br /&gt;
        outputChatBox ( text ) --output that text&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientGUIClick&amp;quot;, button, outputEditBox )&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This example creates an edit box and sets the input focus so the player does not have to click before typing:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, &amp;quot;&amp;quot;, true )&lt;br /&gt;
guiBringToFront( editBox )&lt;br /&gt;
guiEditSetCaretIndex( editBox, 1 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;br /&gt;
[[ru:guiCreateEdit]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:SDraw&amp;diff=44765</id>
		<title>User:SDraw</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:SDraw&amp;diff=44765"/>
		<updated>2015-03-02T00:19:22Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What are you searching for?&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadDFF&amp;diff=44737</id>
		<title>EngineLoadDFF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadDFF&amp;diff=44737"/>
		<updated>2015-02-25T16:20:09Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Note box|Please note the loading order that is used in the examples as other orders can cause collisions, textures or the DFF not to load due to technical limitations}}&lt;br /&gt;
&lt;br /&gt;
This function loads a RenderWare Model (DFF) file into GTA.&lt;br /&gt;
&lt;br /&gt;
* To successfully load vehicle models, it is necessary to pass the vehicle model id to the function so any embedded DFF extensions (such as collisions) will be loaded correctly.&lt;br /&gt;
* To successfully load your model with textures, be sure to use [[engineLoadTXD]] and [[engineImportTXD]] before calling this function.&lt;br /&gt;
&lt;br /&gt;
This is a client side function. Be sure to transfer your DFF file by including it in the meta file.&lt;br /&gt;
&lt;br /&gt;
The returned [[DFF]] element is an element in the element tree, just like vehicles and objects. When the dff is destroyed, ie on resource unload or using [[destroyElement]], any elements that use the DFF, such as vehicles or objects will be reset.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dff engineLoadDFF ( string dff_file, int model_id ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[DFF|EngineDFF]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''dff_file:''' The [[filepath]] to the DFF file you want to load&lt;br /&gt;
*'''model_id:''' The model id that should be associated with the dff. (This value is ignored after 1.3.1 and can be set to zero for all models)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[DFF]] element if the dff file loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0150|1.4.1|7088|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dff engineLoadDFF ( string dff_file / string raw_data, int model_id [, bool is_raw = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''dff_file / raw_data:''' The [[filepath]] to the DFF file you want to load or whole data buffer of the DFF file.&lt;br /&gt;
*'''model_id:''' The model id that should be associated with the dff. (This value is ignored after 1.3.1 and can be set to zero for all models)&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''is_raw:''' If set to ''true'', first argument will be recognized as data buffer.&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[DFF]] element if the dff file loaded, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example loads a combination of a custom DFF and TXD file to replace the Euros vehicle in-game. The collisions are embedded inside the DFF file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; replacing the euros vehicle&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
txd = engineLoadTXD ( &amp;quot;data/euros.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd, 587 )&lt;br /&gt;
dff = engineLoadDFF ( &amp;quot;data/euros.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff, 587 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example loads a combination of custom TXD, COL and DFF files to replace an in-game model of a set of floors.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; loading floor objects&amp;quot; )&lt;br /&gt;
col_floors = engineLoadCOL ( &amp;quot;models/office_floors.col&amp;quot; )&lt;br /&gt;
engineReplaceCOL ( col_floors, 3781 )&lt;br /&gt;
txd_floors = engineLoadTXD ( &amp;quot;models/office_floors.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd_floors, 3781 )&lt;br /&gt;
dff_floors = engineLoadDFF ( &amp;quot;models/office_floors.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff_floors, 3781 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadCOL&amp;diff=44736</id>
		<title>EngineLoadCOL</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadCOL&amp;diff=44736"/>
		<updated>2015-02-25T16:10:26Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Note box|Please note the loading order that is used in the examples as other orders can cause collisions, textures or the DFF not to load due to technical limitations}}&lt;br /&gt;
&lt;br /&gt;
This function loads a RenderWare Collision (COL 1/2/3) file into GTA. The collisions can then be used to provide collisions for in-game objects.&lt;br /&gt;
&lt;br /&gt;
For vehicles, please omit this function by embedding your [[COL]] file into your [[DFF]] file. This way, you can be sure that the COL file is correctly (and automatically) loaded when calling [[engineLoadDFF]].&lt;br /&gt;
&lt;br /&gt;
This is a client side function. Be sure to transfer your COL file by including it in the meta file.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' collision libraries (.col files containing multiple collision models) are not supported. See [[COL]] for details.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
col engineLoadCOL ( string col_file ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[COL|EngineCOL]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''col_file:''' The [[filepath]] to the [[COL]] file you want to load&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[COL]] if the file was loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0150|1.4.1|7088|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
col engineLoadCOL ( string col_file / string raw_data [, is_raw = false ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''col_file / raw_data:''' The [[filepath]] to the [[COL]] file you want to load or whole data buffer of the COL file.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''is_raw:''' If set to ''true'', first argument will be recognized as data buffer.&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[COL]] if the file was loaded, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example loads a combination of a custom DFF and TXD file to replace the Euros vehicle in-game. The collisions are embedded inside the DFF file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; replacing the euros vehicle&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
txd = engineLoadTXD ( &amp;quot;data/euros.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd, 587 )&lt;br /&gt;
dff = engineLoadDFF ( &amp;quot;data/euros.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff, 587 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example loads a combination of custom COL, TXD and DFFfiles to replace an in-game model of a set of floors.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; loading floor objects&amp;quot; )&lt;br /&gt;
col_floors = engineLoadCOL ( &amp;quot;models/office_floors.col&amp;quot; )&lt;br /&gt;
engineReplaceCOL ( col_floors, 3781 )&lt;br /&gt;
txd_floors = engineLoadTXD ( &amp;quot;models/office_floors.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd_floors, 3781 )&lt;br /&gt;
dff_floors = engineLoadDFF ( &amp;quot;models/office_floors.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff_floors, 3781 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadTXD&amp;diff=44735</id>
		<title>EngineLoadTXD</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadTXD&amp;diff=44735"/>
		<updated>2015-02-25T16:05:18Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Note box|Please note the loading order that is used in the examples as other orders can cause collisions, textures or the DFF not to load due to technical limitations}}&lt;br /&gt;
&lt;br /&gt;
This function loads a RenderWare Texture Dictionary (TXD) file into GTA. The texture dictionary can then be used to provide textures.&lt;br /&gt;
&lt;br /&gt;
This is a client side function. Be sure to transfer your TXD file by including it in the meta file.&lt;br /&gt;
&lt;br /&gt;
See here for [[Optimize_Custom_TXD|tips on reducing the size of TXD files]].&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
txd engineLoadTXD ( string txd_file [, bool filteringEnabled = true ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
[[Image:Filtering.jpg|thumb|Difference between texture filtering modes (left = filtering disabled, right = filtering enabled).|284x230px]]&lt;br /&gt;
{{OOP||[[TXD|EngineTXD]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''txd_file:''' The [[filepath]] to the txd file you want to load&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''filteringEnabled:''' Whether to enable texture filtering.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[TXD]] if the file was loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0150|1.4.1|7088|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
txd engineLoadTXD ( string txd_file / string raw_data [, bool filteringEnabled = true, bool is_raw = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''txd_file / raw_data:''' The [[filepath]] to the TXD file you want to load or whole data buffer of the TXD file.&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''filteringEnabled:''' Whether to enable texture filtering.&lt;br /&gt;
*'''is_raw:''' If set to ''true'', first argument will be recognized as data buffer.&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[TXD]] if the file was loaded, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example loads a combination of a custom DFF and TXD file to replace the Euros vehicle in-game. The collisions are embedded inside the DFF file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; replacing the euros vehicle&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
txd = engineLoadTXD ( &amp;quot;data/euros.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd, 587 )&lt;br /&gt;
dff = engineLoadDFF ( &amp;quot;data/euros.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff, 587 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example loads a combination of custom COL, TXD and DFF files to replace an in-game model of a set of floors.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; loading floor objects&amp;quot; )&lt;br /&gt;
col_floors = engineLoadCOL ( &amp;quot;models/office_floors.col&amp;quot; )&lt;br /&gt;
engineReplaceCOL ( col_floors, 3781 )&lt;br /&gt;
txd_floors = engineLoadTXD ( &amp;quot;models/office_floors.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd_floors, 3781 )&lt;br /&gt;
dff_floors = engineLoadDFF ( &amp;quot;models/office_floors.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff_floors, 3781 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadDFF&amp;diff=44734</id>
		<title>EngineLoadDFF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadDFF&amp;diff=44734"/>
		<updated>2015-02-25T15:59:30Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Note box|Please note the loading order that is used in the examples as other orders can cause collisions, textures or the DFF not to load due to technical limitations}}&lt;br /&gt;
&lt;br /&gt;
This function loads a RenderWare Model (DFF) file into GTA.&lt;br /&gt;
&lt;br /&gt;
* To successfully load vehicle models, it is necessary to pass the vehicle model id to the function so any embedded DFF extensions (such as collisions) will be loaded correctly.&lt;br /&gt;
* To successfully load your model with textures, be sure to use [[engineLoadTXD]] and [[engineImportTXD]] before calling this function.&lt;br /&gt;
&lt;br /&gt;
This is a client side function. Be sure to transfer your DFF file by including it in the meta file.&lt;br /&gt;
&lt;br /&gt;
The returned [[DFF]] element is an element in the element tree, just like vehicles and objects. When the dff is destroyed, ie on resource unload or using [[destroyElement]], any elements that use the DFF, such as vehicles or objects will be reset.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dff engineLoadDFF ( string dff_file, int model_id ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[DFF|EngineDFF]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''dff_file:''' The [[filepath]] to the DFF file you want to load&lt;br /&gt;
*'''model_id:''' The model id that should be associated with the dff. (This value is ignored after 1.3.1 and can be set to zero for all models)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[DFF]] element if the dff file loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0150|1.4.1|7088|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dff engineLoadDFF ( string dff_file / string raw_data, int model_id, bool is_raw = false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''dff_file / raw_data:''' The [[filepath]] to the DFF file you want to load or whole data buffer of the DFF file.&lt;br /&gt;
*'''model_id:''' The model id that should be associated with the dff. (This value is ignored after 1.3.1 and can be set to zero for all models)&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''is_raw:''' If set to ''true'', first argument will be recognized as data buffer.&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[DFF]] element if the dff file loaded, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example loads a combination of a custom DFF and TXD file to replace the Euros vehicle in-game. The collisions are embedded inside the DFF file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; replacing the euros vehicle&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
txd = engineLoadTXD ( &amp;quot;data/euros.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd, 587 )&lt;br /&gt;
dff = engineLoadDFF ( &amp;quot;data/euros.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff, 587 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example loads a combination of custom TXD, COL and DFF files to replace an in-game model of a set of floors.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; loading floor objects&amp;quot; )&lt;br /&gt;
col_floors = engineLoadCOL ( &amp;quot;models/office_floors.col&amp;quot; )&lt;br /&gt;
engineReplaceCOL ( col_floors, 3781 )&lt;br /&gt;
txd_floors = engineLoadTXD ( &amp;quot;models/office_floors.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd_floors, 3781 )&lt;br /&gt;
dff_floors = engineLoadDFF ( &amp;quot;models/office_floors.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff_floors, 3781 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineLoadDFF&amp;diff=44733</id>
		<title>EngineLoadDFF</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineLoadDFF&amp;diff=44733"/>
		<updated>2015-02-25T15:57:52Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Note box|Please note the loading order that is used in the examples as other orders can cause collisions, textures or the DFF not to load due to technical limitations}}&lt;br /&gt;
&lt;br /&gt;
This function loads a RenderWare Model (DFF) file into GTA.&lt;br /&gt;
&lt;br /&gt;
* To successfully load vehicle models, it is necessary to pass the vehicle model id to the function so any embedded DFF extensions (such as collisions) will be loaded correctly.&lt;br /&gt;
* To successfully load your model with textures, be sure to use [[engineLoadTXD]] and [[engineImportTXD]] before calling this function.&lt;br /&gt;
&lt;br /&gt;
This is a client side function. Be sure to transfer your DFF file by including it in the meta file.&lt;br /&gt;
&lt;br /&gt;
The returned [[DFF]] element is an element in the element tree, just like vehicles and objects. When the dff is destroyed, ie on resource unload or using [[destroyElement]], any elements that use the DFF, such as vehicles or objects will be reset.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dff engineLoadDFF ( string dff_file, int model_id ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[DFF|EngineDFF]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''dff_file:''' The [[filepath]] to the DFF file you want to load&lt;br /&gt;
*'''model_id:''' The model id that should be associated with the dff. (This value is ignored after 1.3.1 and can be set to zero for all models)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[DFF]] element if the dff file loaded, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0150|1.4.1|7088|&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
dff engineLoadDFF ( string dff_file / string raw_data, int model_id, bool is_raw = false )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''dff_file / raw_data:''' The [[filepath]] to the DFF file you want to load or whole data buffer of the DFF file.&lt;br /&gt;
*'''model_id:''' The model id that should be associated with the dff. (This value is ignored after 1.3.1 and can be set to zero for all models)&lt;br /&gt;
*'''is_raw:''' If set to ''true'', first argument will be recognized as data buffer.&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[DFF]] element if the dff file loaded, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
'''Example 1:''' This example loads a combination of a custom DFF and TXD file to replace the Euros vehicle in-game. The collisions are embedded inside the DFF file.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; replacing the euros vehicle&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
txd = engineLoadTXD ( &amp;quot;data/euros.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd, 587 )&lt;br /&gt;
dff = engineLoadDFF ( &amp;quot;data/euros.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff, 587 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' This example loads a combination of custom TXD, COL and DFF files to replace an in-game model of a set of floors.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
outputChatBox ( &amp;quot;&amp;gt; loading floor objects&amp;quot; )&lt;br /&gt;
col_floors = engineLoadCOL ( &amp;quot;models/office_floors.col&amp;quot; )&lt;br /&gt;
engineReplaceCOL ( col_floors, 3781 )&lt;br /&gt;
txd_floors = engineLoadTXD ( &amp;quot;models/office_floors.txd&amp;quot; )&lt;br /&gt;
engineImportTXD ( txd_floors, 3781 )&lt;br /&gt;
dff_floors = engineLoadDFF ( &amp;quot;models/office_floors.dff&amp;quot;, 0 )&lt;br /&gt;
engineReplaceModel ( dff_floors, 3781 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Shader_examples&amp;diff=41385</id>
		<title>Shader examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Shader_examples&amp;diff=41385"/>
		<updated>2014-08-15T11:32:51Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Hud mask */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains some example shader resources to try. If you are looking to make your own, please be sure to read about the [[Shader|shader element]] as well.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
==Road shine==&lt;br /&gt;
[[Image:RoadShineScreen.jpg|200px|thumb|left|Road shine]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_roadshine.zip Download shader_roadshine.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource creates a light reflection effect on the ground (looks best when moving). &lt;br /&gt;
It uses a custom flag in the effect file to generate [http://en.wikipedia.org/wiki/Surface_normal surface normals] for the ground model:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int CUSTOMFLAGS&lt;br /&gt;
&amp;lt;&lt;br /&gt;
    string createNormals = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;gt;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Surface normals are not usually present in the ground and building models, but are useful for creating lighting effects such as these.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Road shine 2==&lt;br /&gt;
[[Image:RoadShine2Screen.jpg|200px|thumb|left|Road shine 2]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_roadshine2.zip Download shader_roadshine2.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Bit more complicated than the first Road shine, as it tracks the sun or moon to calculate the position of the highlight.&lt;br /&gt;
The effect can be hard to see depending on the time of day.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Best used with the play resource as the model it modifies is near the initial spawn point.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Road shine 3 (Deluxe edition)==&lt;br /&gt;
[[Image:RoadShine3Screen.jpg|200px|thumb|left|Road shine 3]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_roadshine3.zip Download shader_roadshine3.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource shows how to:&lt;br /&gt;
* Stop a wild card match shader from being applied to certain world textures.&lt;br /&gt;
* Use isLineOfSightClear to stop an effect when something is not visible (The sun in this case).&lt;br /&gt;
* Use a shader maxDrawDistance setting to avoid GPU overload.&lt;br /&gt;
&lt;br /&gt;
The final effect is a faster shader with less rendering issues than the previous two road shine examples.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UV scroll==&lt;br /&gt;
[[Image:UVScollScreen.jpg|200px|thumb|left|UV scroll]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_uv_scroll.zip Download shader_uv_scroll.zip]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource scrolls a texture from left to right. It doesn't use vertex or pixels shaders, so it should work on all hardware.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UV scripted==&lt;br /&gt;
[[Image:UVScriptedScreen.jpg|200px|thumb|left|UV scripted]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_uv_scripted.zip Download shader_uv_scripted.zip]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource controls a texture's UVs using Lua. It shows that anything is possible if you can imagine it.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Car paint==&lt;br /&gt;
[[Image:CarPaintScreen.jpg|200px|thumb|left|Car paint]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_car_paint.zip Download shader_car_paint.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource shows you how to apply a shader to the vehicle models. The shader itself is not that great, so don't get your hopes up.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Water==&lt;br /&gt;
[[Image:WaterScreen.jpg|200px|thumb|left|Water]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_water.zip Download shader_water.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource applies a shader to the GTA world water. The Lua script shows how to use a timer to transfer the conventional water color setting to the shader.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Bloom==&lt;br /&gt;
[[Image:BloomScreen.jpg|200px|thumb|left|Bloom]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_bloom.zip Download shader_bloom.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource shows you how 'bounce' full screen effects using a render target pool. It uses the ''onClientHUDRender'' event to exclude the HUD from the effect.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Block world==&lt;br /&gt;
[[Image:BlockWorld.jpg|200px|thumb|left|Block world]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_block_world.zip Download shader_block_world.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource makes the textures look all blocky. It also changes colors when the 'k' key is pressed.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Texture names==&lt;br /&gt;
[[Image:TexNames.jpg|200px|thumb|left|Texture names]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_tex_names.zip Download shader_tex_names.zip]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource is only a tool, and doesn't do anything pretty. It shows a list of the current visible texture names, and highlights the selected texture. Ideal for finding a texture name to use with [[engineApplyShaderToWorldTexture]].&lt;br /&gt;
&lt;br /&gt;
num_8 shows/hides the texture list, num_7 and num_9 step through the list, and 'k' copies the current texture name to the clipboard.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Skid marks==&lt;br /&gt;
[[Image:SkidMarks.jpg|200px|thumb|left|Skid marks]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_skidmarks.zip Download shader_skidmarks.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource shows you how to do multiple passes in a shader, and input different variables to the vertex shader for each pass.&lt;br /&gt;
Use the command '''/skidmarks 1-4''' to see the different effects. (You have skid a car to see it!)&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==HDR contrast==&lt;br /&gt;
[[Image:ShaderContrast.jpg|200px|thumb|left|HDR contrast]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_contrast.zip Download shader_contrast.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource applies a 'High Dynamic Range' contrast effect. It uses a 1 pixel render target to sample the whole scene, and then uses that to brighten or darken the next frame.&lt;br /&gt;
So going into somewhere dark will automatically brighten the scene, and visa versa&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Tessellation==&lt;br /&gt;
[[Image:shader_flag.jpg|200px|thumb|left|Tessellation action]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_flag.zip Download shader_flag.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource shows how to use shader tessellation to animate the shape of a dxDrawImage and use shader transform to give it a 3rd dimension.&lt;br /&gt;
&lt;br /&gt;
The example has a GUI (press numpad-8) so you can fiddle with the settings.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Radial blur==&lt;br /&gt;
[[Image:shader_radial_blur.jpg|200px|thumb|left|Radial blur]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_radial_blur.zip Download shader_radial_blur.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource sort of looks a little bit like the GTAIV motion blur you get when you move the mouse quickly, or drive a fast car. The fast car effect is a bit more subtle than the screen shot would suggest, as it leaves the center of the screen nice and clear so you can see where you are going.&lt;br /&gt;
&lt;br /&gt;
It also has the option of suspending the effect during times of low FPS. Check the two settings at the top of '''''c_radial_blur.lua'''''.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The file '''''c_switch.lua''''' contains information on how to toggle the effect from another resource using events.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Detail==&lt;br /&gt;
[[Image:shader_detail.jpg|200px|thumb|left|Detail]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_detail.zip Download shader_detail.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Applies a few monochrome detail textures, at various scales, to (parts of) the world.&lt;br /&gt;
&lt;br /&gt;
(Not finished and probably never will be.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Ped morph==&lt;br /&gt;
[[Image:PedMorphScreen.jpg|200px|thumb|left|Ped morph]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_ped_morph.zip Download shader_ped_morph.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource uses a vertex shader to modify the geometry of a ped model as it is rendered.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
When the resource has started, use the 'k' and 'l' keys to change morph size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Ped shell==&lt;br /&gt;
[[Image:PedShellScreen.jpg|200px|thumb|left|Ped shell]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_ped_shell.zip Download shader_ped_shell.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource draws a translucent effect as a shader layer. The first pass is done by GTA, and the vertex shader is only applied in the second to add the effect 'on top' of the standard output.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
When the resource has started, use the 'm' key to see the shell effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Hud mask==&lt;br /&gt;
[[Image:Shader_hud_mask.jpg|200px|thumb|left|Hud mask]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_hud_mask.zip Download shader_hud_mask.zip]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource shows how to draw a hud texture with a shape mask.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=41114</id>
		<title>SetSoundPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=41114"/>
		<updated>2014-08-01T22:04:45Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the seek position of the specified [[sound]] element.&lt;br /&gt;
Use a player element to control a players voice with this function.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPosition ( element theSound, float pos )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which seek position you want to modify.&lt;br /&gt;
*'''pos:''' An float value representing the new seek position of the sound. Integer part of this value - seconds, fractional part - milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example allows the player to set how many milliseconds into the song he wants it to play from&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function setSongPos(cmd, tm)&lt;br /&gt;
    tm = tonumber(tm)&lt;br /&gt;
    local ssp = setSoundPosition(theSound,tm)&lt;br /&gt;
    if ssp then&lt;br /&gt;
        outputChatBox(&amp;quot;Sound is now playing from: &amp;quot;..tostring(tm))&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;An error has occured.&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;skipsong&amp;quot;, setSongPos)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element for voice control}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundPosition]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=40886</id>
		<title>SetSoundPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetSoundPosition&amp;diff=40886"/>
		<updated>2014-07-15T23:13:21Z</updated>

		<summary type="html">&lt;p&gt;SDraw: Wrong parameter description and sample code&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to change the seek position of the specified [[sound]] element.&lt;br /&gt;
Use a player element to control a players voice with this function.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setSoundPosition ( element theSound, float pos )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which seek position you want to modify.&lt;br /&gt;
*'''pos:''' An float value representing the new seek position of the sound. Integer part of this value - seconds, fractional part - milliseconds.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the [[sound]] element's seek position was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example allows the player to set how many milliseconds into the song he wants it to play from&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theSound = playSound(&amp;quot;music/song.mp3&amp;quot;)&lt;br /&gt;
function setSongPos(cmd, tm)&lt;br /&gt;
    tm = tonumber(tm)&lt;br /&gt;
    local ssp = setSoundPosition(theSound,tm)&lt;br /&gt;
    if ssp then&lt;br /&gt;
        outputChatBox(&amp;quot;Sound is now playing from: &amp;quot;..tostring(tm))&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox(&amp;quot;An error has occured. Please make sure there are at least&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;skipsong&amp;quot;, setSongPos)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element for voice control}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:setSoundPosition]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsElementFrozen&amp;diff=39412</id>
		<title>IsElementFrozen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsElementFrozen&amp;diff=39412"/>
		<updated>2014-04-19T15:11:16Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function checks if element has been frozen.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool isElementFrozen ( element theElement )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' the element whose freeze status we want to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*Returns ''true'' if the element is frozen, ''false'' if it isn't or if invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example binds the &amp;quot;p&amp;quot; key to a function to freeze/unfreeze the player's current vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- this function freezes or unfreezes the specified player's vehicle, if he's in one&lt;br /&gt;
function toggleFreezeStatus ( thePlayer )&lt;br /&gt;
	-- get the vehicle element&lt;br /&gt;
	local playerVehicle = getPlayerOccupiedVehicle ( thePlayer )&lt;br /&gt;
&lt;br /&gt;
	if playerVehicle then&lt;br /&gt;
		-- get the current freeze status&lt;br /&gt;
		local currentFreezeStatus = isElementFrozen ( playerVehicle )&lt;br /&gt;
		-- get the new freeze status (the opposite of the previous)&lt;br /&gt;
		local newFreezeStatus = not currentFreezeStatus&lt;br /&gt;
		-- set the new freeze status&lt;br /&gt;
		setElementFrozen ( playerVehicle, newFreezeStatus )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- now make this function available as key bind to all players.&lt;br /&gt;
-- first, get the list of players&lt;br /&gt;
local connectedPlayers = getElementsByType ( &amp;quot;player&amp;quot; )&lt;br /&gt;
-- for each one in it,&lt;br /&gt;
for i, aPlayer in ipairs(connectedPlayers) do&lt;br /&gt;
	-- bind the player's &amp;quot;p&amp;quot; key to the toggleFreezeStatus function&lt;br /&gt;
	bindKey ( aPlayer, &amp;quot;p&amp;quot;, &amp;quot;down&amp;quot;, &amp;quot;Toggle freeze status&amp;quot;, toggleFreezeStatus )&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;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39083</id>
		<title>Talk:Base64Encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39083"/>
		<updated>2014-03-14T17:43:37Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39082</id>
		<title>Talk:Base64Encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39082"/>
		<updated>2014-03-14T17:38:31Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39081</id>
		<title>Talk:Base64Encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39081"/>
		<updated>2014-03-14T17:34:05Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39080</id>
		<title>Talk:Base64Encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39080"/>
		<updated>2014-03-14T17:33:05Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39079</id>
		<title>Talk:Base64Encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:Base64Encode&amp;diff=39079"/>
		<updated>2014-03-14T17:32:40Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Base64encode&amp;diff=39076</id>
		<title>Base64encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Base64encode&amp;diff=39076"/>
		<updated>2014-03-14T14:44:43Z</updated>

		<summary type="html">&lt;p&gt;SDraw: moved Base64encode to Base64Encode over redirect: It's 'Encode'. Try in any script before editing.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Base64Encode]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Base64Encode&amp;diff=39075</id>
		<title>Base64Encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Base64Encode&amp;diff=39075"/>
		<updated>2014-03-14T14:44:43Z</updated>

		<summary type="html">&lt;p&gt;SDraw: moved Base64encode to Base64Encode over redirect: It's 'Encode'. Try in any script before editing.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|9.06056|1.3.5|6056|&lt;br /&gt;
This function returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block of data&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string base64Encode ( string data )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''data:''' The block of data you want to encrypt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted data if the encryption process was successfully completed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local k = base64Encode(&amp;quot;Hello, world!&amp;quot;)&lt;br /&gt;
outputConsole(k)&lt;br /&gt;
--Output: SGVsbG8sIHdvcmxkIQ==&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Base64decode&amp;diff=39074</id>
		<title>Base64decode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Base64decode&amp;diff=39074"/>
		<updated>2014-03-14T14:43:19Z</updated>

		<summary type="html">&lt;p&gt;SDraw: moved Base64decode to Base64Decode over redirect: It's 'Decode'. Try in any script before editing.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Base64Decode]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Base64Decode&amp;diff=39073</id>
		<title>Base64Decode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Base64Decode&amp;diff=39073"/>
		<updated>2014-03-14T14:43:19Z</updated>

		<summary type="html">&lt;p&gt;SDraw: moved Base64decode to Base64Decode over redirect: It's 'Decode'. Try in any script before editing.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|9.06056|1.3.5|6056|&lt;br /&gt;
This function returns the decrypted data from [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string base64Decode(string data)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''data:''' The block of data you want to decrypt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the decrypted data from [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block if the decryption process was successfully completed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local k = base64Decode(&amp;quot;SGVsbG8sIHdvcmxkIQ==&amp;quot;)&lt;br /&gt;
outputConsole(k)&lt;br /&gt;
--Output: Hello, world!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Base64Encode&amp;diff=39072</id>
		<title>Base64Encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Base64Encode&amp;diff=39072"/>
		<updated>2014-03-14T14:39:58Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|9.06056|1.3.5|6056|&lt;br /&gt;
This function returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block of data&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string base64Encode ( string data )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''data:''' The block of data you want to encrypt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted data if the encryption process was successfully completed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local k = base64Encode(&amp;quot;Hello, world!&amp;quot;)&lt;br /&gt;
outputConsole(k)&lt;br /&gt;
--Output: SGVsbG8sIHdvcmxkIQ==&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Base64Decode&amp;diff=39071</id>
		<title>Base64Decode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Base64Decode&amp;diff=39071"/>
		<updated>2014-03-14T14:39:36Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|9.06056|1.3.5|6056|&lt;br /&gt;
This function returns the decrypted data from [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string base64Decode(string data)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''data:''' The block of data you want to decrypt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the decrypted data from [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block if the decryption process was successfully completed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local k = base64Decode(&amp;quot;SGVsbG8sIHdvcmxkIQ==&amp;quot;)&lt;br /&gt;
outputConsole(k)&lt;br /&gt;
--Output: Hello, world!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Base64Decode&amp;diff=39063</id>
		<title>Base64Decode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Base64Decode&amp;diff=39063"/>
		<updated>2014-03-14T14:05:34Z</updated>

		<summary type="html">&lt;p&gt;SDraw: Created page with &amp;quot;__NOTOC__ {{Server client function}} {{New feature/item|9.06056|1.3.5|6056| This function returns the decrypted data from [https://en.wikipedia.org/wiki/Base64 base64] representa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|9.06056|1.3.5|6056|&lt;br /&gt;
This function returns the decrypted data from [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string base64Decode(string data)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''data:''' The block of data you want to decrypt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the decrypted data from [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block if the decryption process was successfully completed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local k = base64Encode(&amp;quot;SGVsbG8sIHdvcmxkIQ==&amp;quot;)&lt;br /&gt;
outputConsole(k)&lt;br /&gt;
--Output: Hello, world!&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Base64Encode&amp;diff=39062</id>
		<title>Base64Encode</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Base64Encode&amp;diff=39062"/>
		<updated>2014-03-14T13:59:22Z</updated>

		<summary type="html">&lt;p&gt;SDraw: Created page with &amp;quot;__NOTOC__ {{Server client function}} {{New feature/item|9.06056|1.3.5|6056| This function returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypte...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|9.06056|1.3.5|6056|&lt;br /&gt;
This function returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted block of data&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string base64Encode(string/int data)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''data:''' The block of data you want to encrypt&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [https://en.wikipedia.org/wiki/Base64 base64] representation of the encrypted data if the encryption process was successfully completed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local k = base64Encode(&amp;quot;Hello, world!&amp;quot;)&lt;br /&gt;
outputConsole(k)&lt;br /&gt;
--Output: SGVsbG8sIHdvcmxkIQ==&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=BitTest&amp;diff=38870</id>
		<title>BitTest</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=BitTest&amp;diff=38870"/>
		<updated>2014-02-17T11:00:27Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.0132|1.3.2|5340|&lt;br /&gt;
This function performs an AND-conjunction on two or more (unsigned) 32-bit [[Int|integers]] and checks, whether the conjuncted value is zero or not. See [http://en.wikipedia.org/wiki/Bitwise_operation#AND Bitwise operation] for more details.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool bitTest ( uint var1, uint var2, ... )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''varN:''' The value you want to perform the operation on (see above)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the conjuncted value is '''not''' zero, ''false'' otherwise. If a bad argument was passed to [[bitTest]], you'll get ''nil''.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local flags = 0x23 -- binary: 100011b&lt;br /&gt;
local mask = 0x20  -- binary: 100000b&lt;br /&gt;
&lt;br /&gt;
-- Check if bit 1 is set&lt;br /&gt;
if bitTest(flags, mask) then&lt;br /&gt;
    outputDebugString(&amp;quot;Yeah. It's set&amp;quot;)&lt;br /&gt;
else&lt;br /&gt;
    outputDebugString(&amp;quot;I'm sorry ;(&amp;quot;)&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Bit_functions}}&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundPan&amp;diff=37960</id>
		<title>GetSoundPan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundPan&amp;diff=37960"/>
		<updated>2013-12-19T21:11:22Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Required Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to get the pan level of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getSoundPan ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which pan you want to get.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''float'' value with range from ''-1.0 (left)'' to ''1.0 (right)'', ''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;
function playMusic ()&lt;br /&gt;
        local song = playSound('song.mp3')&lt;br /&gt;
        setSoundPan(song, 0.3)&lt;br /&gt;
        outputChatBox(&amp;quot;Current pan is &amp;quot;..tostring(getSoundPan(song)))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;music&amp;quot;, playMusic)&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;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundPan&amp;diff=37959</id>
		<title>GetSoundPan</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundPan&amp;diff=37959"/>
		<updated>2013-12-19T21:07:45Z</updated>

		<summary type="html">&lt;p&gt;SDraw: Created page with &amp;quot;__NOTOC__  {{Client function}} This function is used to get the pan level of the specified sound element.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getSoundPan ( element theSound )&amp;lt;/co...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to get the pan level of the specified [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;float getSoundPan ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound:''' The [[sound]] element which pan you want to modify.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''float'' value with range from ''-1.0 (left)'' to ''1.0 (right)'', ''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;
function playMusic ()&lt;br /&gt;
        local song = playSound('song.mp3')&lt;br /&gt;
        setSoundPan(song, 0.3)&lt;br /&gt;
        outputChatBox(&amp;quot;Current pan is &amp;quot;..tostring(getSoundPan(song)))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addCommandHandler(&amp;quot;music&amp;quot;, playMusic)&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;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=37932</id>
		<title>GetSoundLevelData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=37932"/>
		<updated>2013-12-16T21:13:10Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the left/right level from a [[sound]] [[element]].&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int, int getSoundLevelData ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound''' The [[sound]] [[element]] which level data you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a 2 values with Left, Right level data from sound (range is [0,32768]), ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code creates vertical lines of right and left level in center of screen from top to bottom. [http://imageshack.com/a/img716/8689/4ud1.png] Key '''9''' - start, key '''0''' - stop.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local handl = nil&lt;br /&gt;
local sx,_ = guiGetScreenSize()&lt;br /&gt;
local colors = { tocolor(255,0,0),tocolor(0,255,0) }&lt;br /&gt;
 &lt;br /&gt;
function clientRenderFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
	local ls,rs = getSoundLevelData(handl)&lt;br /&gt;
	if(ls ~= false) then&lt;br /&gt;
            dxDrawRectangle(sx/2-10,0,10,128*(ls/32768),colors[1])&lt;br /&gt;
            dxDrawRectangle(sx/2+10,0,10,128*(rs/32768),colors[2])&lt;br /&gt;
	end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function clientSoundStopFunc(_)&lt;br /&gt;
    if(source == handl) then&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
	handl = nil&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStartFunc()&lt;br /&gt;
    if(not handl) then&lt;br /&gt;
        handl = playSound('nya.mp3')&lt;br /&gt;
        addEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	addEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStopFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        stopSound(handl)&lt;br /&gt;
        handl = nil&lt;br /&gt;
        removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
bindKey(&amp;quot;9&amp;quot;,&amp;quot;down&amp;quot;,musicStartFunc)&lt;br /&gt;
bindKey(&amp;quot;0&amp;quot;,&amp;quot;down&amp;quot;,musicStopFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:getSoundLevelData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:SDraw&amp;diff=37931</id>
		<title>User:SDraw</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:SDraw&amp;diff=37931"/>
		<updated>2013-12-15T21:41:46Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;What are you searching for? Master hasn't added anything yet. [http://imageshack.com/a/img844/6804/z2k.gif]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=37930</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=37930"/>
		<updated>2013-12-15T20:32:52Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the fast fourier transform data for an audio stream which is a table of floats representing the current audio frame.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
a fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
&lt;br /&gt;
Should you have any problems there is an example resource located on the resource svn here:&lt;br /&gt;
[https://code.google.com/p/mtasa-resources/source/browse/#svn%2Ftrunk%2F%5Bgameplay%5D%2FVisualiser Visualiser]&lt;br /&gt;
&lt;br /&gt;
just type &amp;quot;startmusic mystreamurl&amp;quot; in your console and it will play on the cinema billboard near A51&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' Allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' Post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 (or '''iBands'''-1 if '''iBands''' is used) floats representing the current audio frame.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This code creates vertical spectrum analyzer with thin lines in center of screen from top to bottom. [http://imageshack.com/a/img543/79/i4oz.png] Key '''9''' - start, key '''0''' - stop.&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 handl = nil&lt;br /&gt;
local sx,_ = guiGetScreenSize()&lt;br /&gt;
local colors = { tocolor(255,0,0),tocolor(0,255,0) }&lt;br /&gt;
 &lt;br /&gt;
function clientRenderFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
	dxDrawRectangle(sx/2,0,1,256,tocolor(255,255,255,127))&lt;br /&gt;
        local bt = getSoundFFTData(handl,2048,257)&lt;br /&gt;
	if(not bt) then return end&lt;br /&gt;
        for i=1,256 do&lt;br /&gt;
            bt[i] = math.sqrt(bt[i])*256 --scale it (sqrt to make low values more visible)&lt;br /&gt;
            dxDrawRectangle(sx/2-bt[i]/2,i-1,bt[i],1)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function clientSoundStopFunc(_)&lt;br /&gt;
    if(source == handl) then&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
	handl = nil&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStartFunc()&lt;br /&gt;
    if(not handl) then&lt;br /&gt;
        handl = playSound('nya.mp3')&lt;br /&gt;
        addEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	addEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStopFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        stopSound(handl)&lt;br /&gt;
        handl = nil&lt;br /&gt;
        removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
bindKey(&amp;quot;9&amp;quot;,&amp;quot;down&amp;quot;,musicStartFunc)&lt;br /&gt;
bindKey(&amp;quot;0&amp;quot;,&amp;quot;down&amp;quot;,musicStopFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=37929</id>
		<title>GetSoundWaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=37929"/>
		<updated>2013-12-15T20:25:57Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the wave form data for an audio stream which is a table of floats representing the current audio frame as a wave.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundWaveData ( element sound, int iSamples )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' Allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 floats representing the current audio frame waveform.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code creates vertical waveform of sound in center of screen from top to bottom. [http://imageshack.com/a/img547/9052/xbrp.png] Key '''9''' - start, key '''0''' - stop.&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 handl = nil&lt;br /&gt;
local sx,_ = guiGetScreenSize()&lt;br /&gt;
local colors = { tocolor(255,0,0),tocolor(0,255,0) }&lt;br /&gt;
 &lt;br /&gt;
function clientRenderFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
	dxDrawRectangle(sx/2,0,1,256,tocolor(255,255,255,127))&lt;br /&gt;
        local bt = getSoundWaveData(handl,512)&lt;br /&gt;
	if(not bt) then return end&lt;br /&gt;
	for i=1,127 do&lt;br /&gt;
	    dxDrawLine(sx/2+64*bt[2*i-1],i*2-2,sx/2+64*bt[2*(i+1)-1],(i+1)*2-2,colors[2])&lt;br /&gt;
	    dxDrawLine(sx/2+64*bt[2*i],i*2-1,sx/2+64*bt[2*(i+1)],(i+1)*2-1,colors[1])&lt;br /&gt;
	end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function clientSoundStopFunc(_)&lt;br /&gt;
    if(source == handl) then&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
	handl = nil&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStartFunc()&lt;br /&gt;
    if(not handl) then&lt;br /&gt;
        handl = playSound('btr.mp3')&lt;br /&gt;
        addEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	addEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStopFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
        stopSound(handl)&lt;br /&gt;
        handl = nil&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
bindKey(&amp;quot;9&amp;quot;,&amp;quot;down&amp;quot;,musicStartFunc)&lt;br /&gt;
bindKey(&amp;quot;0&amp;quot;,&amp;quot;down&amp;quot;,musicStopFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:getSoundWaveData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=37928</id>
		<title>GetSoundWaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=37928"/>
		<updated>2013-12-15T15:19:12Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the wave form data for an audio stream which is a table of floats representing the current audio frame as a wave.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundWaveData ( element sound, int iSamples )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' Allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 floats representing the current audio frame waveform.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code creates vertical waveform of sound in center of screen from top to bottom. [http://imageshack.com/a/img547/9052/xbrp.png] Key '''9''' - start, key '''0''' - stop.&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 handl = nil&lt;br /&gt;
local sx,_ = guiGetScreenSize()&lt;br /&gt;
local colors = { tocolor(255,0,0),tocolor(0,255,0) }&lt;br /&gt;
 &lt;br /&gt;
function clientRenderFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
	dxDrawRectangle(sx/2,0,1,256,tocolor(255,255,255,127))&lt;br /&gt;
        local bt = getSoundWaveData(handl,512)&lt;br /&gt;
	if(not bt) return&lt;br /&gt;
	for i=1,127 do&lt;br /&gt;
	    dxDrawLine(sx/2+64*bt[2*i-1],i*2-2,sx/2+64*bt[2*(i+1)-1],(i+1)*2-2,colors[2])&lt;br /&gt;
	    dxDrawLine(sx/2+64*bt[2*i],i*2-1,sx/2+64*bt[2*(i+1)],(i+1)*2-1,colors[1])&lt;br /&gt;
	end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function clientSoundStopFunc(_)&lt;br /&gt;
    if(source == handl) then&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
	handl = nil&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStartFunc()&lt;br /&gt;
    if(not handl) then&lt;br /&gt;
        handl = playSound('btr.mp3')&lt;br /&gt;
        addEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	addEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStopFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
	removeEventHandler(&amp;quot;onClientSoundStopped&amp;quot;,root,clientSoundStopFunc)&lt;br /&gt;
        stopSound(handl)&lt;br /&gt;
        handl = nil&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
bindKey(&amp;quot;9&amp;quot;,&amp;quot;down&amp;quot;,musicStartFunc)&lt;br /&gt;
bindKey(&amp;quot;0&amp;quot;,&amp;quot;down&amp;quot;,musicStopFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:getSoundWaveData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=37927</id>
		<title>GetSoundWaveData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundWaveData&amp;diff=37927"/>
		<updated>2013-12-15T14:38:06Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the wave form data for an audio stream which is a table of floats representing the current audio frame as a wave.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundWaveData ( element sound, int iSamples )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' Allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 floats representing the current audio frame waveform.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code creates vertical waveform of sound in center of screen from top to bottom. [http://imageshack.com/a/img547/9052/xbrp.png] Key '''9''' - start, key '''0''' - stop.&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 handl = nil&lt;br /&gt;
local sx,_ = guiGetScreenSize()&lt;br /&gt;
local colors = { tocolor(255,0,0),tocolor(0,255,0) }&lt;br /&gt;
 &lt;br /&gt;
function clientRenderFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        local bt = getSoundWaveData(handl,512)&lt;br /&gt;
	dxDrawRectangle(sx/2,0,1,256,tocolor(255,255,255,127))&lt;br /&gt;
        for i=1,127 do&lt;br /&gt;
	    dxDrawLine(sx/2+64*bt[2*i],i*2-1,sx/2+64*bt[2*(i+1)],(i+1)*2-1,colors[1])&lt;br /&gt;
	    dxDrawLine(sx/2+64*bt[2*i-1],i*2-2,sx/2+64*bt[2*(i+1)-1],(i+1)*2-2,colors[2])&lt;br /&gt;
	end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStartFunc()&lt;br /&gt;
    if(not handl) then&lt;br /&gt;
        handl = playSound('btr.mp3')&lt;br /&gt;
        addEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStopFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        stopSound(handl)&lt;br /&gt;
        handl = nil&lt;br /&gt;
        removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
bindKey(&amp;quot;9&amp;quot;,&amp;quot;down&amp;quot;,musicStartFunc)&lt;br /&gt;
bindKey(&amp;quot;0&amp;quot;,&amp;quot;down&amp;quot;,musicStopFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:getSoundWaveData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=37926</id>
		<title>GetSoundFFTData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundFFTData&amp;diff=37926"/>
		<updated>2013-12-15T08:33:00Z</updated>

		<summary type="html">&lt;p&gt;SDraw: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the fast fourier transform data for an audio stream which is a table of floats representing the current audio frame.&lt;br /&gt;
This allows things like visualisations.&lt;br /&gt;
&lt;br /&gt;
a fast fourier transform generates a table of all the frequencies of the current audio frame which starts at the bass end of the spectrum to mids to highs in that order&lt;br /&gt;
&lt;br /&gt;
Should you have any problems there is an example resource located on the resource svn here:&lt;br /&gt;
[https://code.google.com/p/mtasa-resources/source/browse/#svn%2Ftrunk%2F%5Bgameplay%5D%2FVisualiser Visualiser]&lt;br /&gt;
&lt;br /&gt;
just type &amp;quot;startmusic mystreamurl&amp;quot; in your console and it will play on the cinema billboard near A51&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundFFTData ( element sound, int iSamples [, int iBands = 0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' A sound element that is created using [[playSound]] or [[playSound3D]]. Streams are also supported&lt;br /&gt;
*'''iSamples:''' Allowed samples are 256, 512, 1024, 2048, 4096, 8192 and 16384.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''iBands:''' Post processing option allows you to split the samples into the desired amount of bands or bars so if you only need 5 bars this saves a lot of cpu power compared to trying to do it in Lua.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table of '''iSamples'''/2 (or '''iBands'''-1 if '''iBands''' is used) floats representing the current audio frame.&lt;br /&gt;
Returns false if the sound is not playing yet or hasn't buffered in the&lt;br /&gt;
case of streams.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This code creates vertical spectrum analyzer with thin lines in center of screen from top to bottom. [http://imageshack.com/a/img543/79/i4oz.png] Key '''9''' - start, key '''0''' - stop.&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 handl = nil&lt;br /&gt;
local sx,_ = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function clientRenderFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        dxDrawRectangle(sx/2,0,1,256,tocolor(255,255,255,127))&lt;br /&gt;
        local bt = getSoundFFTData(handl,2048,257)&lt;br /&gt;
        for i=1,256 do&lt;br /&gt;
            bt[i] = math.sqrt(bt[i])*256 --scale it (sqrt to make low values more visible)&lt;br /&gt;
            dxDrawRectangle(sx/2-bt[i]/2,i-1,bt[i],1)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function musicStartFunc()&lt;br /&gt;
    if(not handl) then&lt;br /&gt;
        handl = playSound('btr.mp3')&lt;br /&gt;
        addEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function musicStopFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        stopSound(handl)&lt;br /&gt;
        handl = nil&lt;br /&gt;
        removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bindKey(&amp;quot;9&amp;quot;,&amp;quot;down&amp;quot;,musicStartFunc)&lt;br /&gt;
bindKey(&amp;quot;0&amp;quot;,&amp;quot;down&amp;quot;,musicStopFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:getSoundFFTData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Timer&amp;diff=37925</id>
		<title>Timer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Timer&amp;diff=37925"/>
		<updated>2013-12-14T22:47:16Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A [[timer]] object refers to a timer set to execute a function a certain number of times with a specified delay.&lt;br /&gt;
&lt;br /&gt;
Note that after a timer has completed all its iterations, it is destroyed and any stored pointers to it become invalid. Also timers are not under the ''resource'' hierarchy, because they are not elements, for instance, if you create a timer, it will not be destroyed when the resource in which it was created is stopped, so in this case you should kill the timer manually.&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
* [[getTimers]]&lt;br /&gt;
* [[killTimer]]&lt;br /&gt;
* [[setTimer]]&lt;br /&gt;
* [[getTimerDetails]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=37922</id>
		<title>GetSoundLevelData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundLevelData&amp;diff=37922"/>
		<updated>2013-12-14T19:18:26Z</updated>

		<summary type="html">&lt;p&gt;SDraw: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the left/right level from a [[sound]] [[element]].&lt;br /&gt;
If the element is a player, this function will use the players voice.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int, int getSoundLevelData ( element theSound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theSound''' The [[sound]] [[element]] which level data you want to return.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a 2 values with Left, Right level data from sound (range is [0,32768]), ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This code creates vertical lines of right and left level in center of screen from top to bottom. [http://imageshack.com/a/img716/8689/4ud1.png] Key '''9''' - start, key '''0''' - stop.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local handl = nil&lt;br /&gt;
local sx,_ = guiGetScreenSize()&lt;br /&gt;
local colors = { tocolor(255,0,0),tocolor(0,255,0) }&lt;br /&gt;
 &lt;br /&gt;
function clientRenderFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        local ls,rs = getSoundLevelData(handl)&lt;br /&gt;
        dxDrawRectangle(sx/2-10,0,10,128*(ls/32768),colors[1])&lt;br /&gt;
        dxDrawRectangle(sx/2+10,0,10,128*(rs/32768),colors[2])&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStartFunc()&lt;br /&gt;
    if(not handl) then&lt;br /&gt;
        handl = playSound('btr.mp3')&lt;br /&gt;
        addEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function musicStopFunc()&lt;br /&gt;
    if(handl) then&lt;br /&gt;
        stopSound(handl)&lt;br /&gt;
        handl = nil&lt;br /&gt;
        removeEventHandler(&amp;quot;onClientRender&amp;quot;,root,clientRenderFunc)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
bindKey(&amp;quot;9&amp;quot;,&amp;quot;down&amp;quot;,musicStartFunc)&lt;br /&gt;
bindKey(&amp;quot;0&amp;quot;,&amp;quot;down&amp;quot;,musicStopFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.04162|}}&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.3.2|Added player element to use a players voice}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:getSoundLevelData]]&lt;/div&gt;</summary>
		<author><name>SDraw</name></author>
	</entry>
</feed>