<?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=Audifire</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=Audifire"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Audifire"/>
	<updated>2026-04-23T23:05:34Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Deref&amp;diff=65850</id>
		<title>Deref</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Deref&amp;diff=65850"/>
		<updated>2020-04-13T23:51:47Z</updated>

		<summary type="html">&lt;p&gt;Audifire: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}} &lt;br /&gt;
This function will take a reference and returns its Lua element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mixed deref( int reference )    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''reference:''' The valid reference, which you want to dereference&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''mixed'' if the reference were valid. Returns ''false'' if the reference were invalid.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Deref&amp;diff=65849</id>
		<title>Deref</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Deref&amp;diff=65849"/>
		<updated>2020-04-13T23:50:50Z</updated>

		<summary type="html">&lt;p&gt;Audifire: Created page with &amp;quot;__NOTOC__  {{Server client function}}  This function will take a reference returns its Lua element.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; mixed deref( int reference )...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}} &lt;br /&gt;
This function will take a reference returns its Lua element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
mixed deref( int reference )    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''reference:''' The valid reference, which you want to dereference&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''mixed'' if the reference were valid. Returns ''false'' if the reference were invalid.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Ref&amp;diff=65848</id>
		<title>Ref</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Ref&amp;diff=65848"/>
		<updated>2020-04-13T23:47:28Z</updated>

		<summary type="html">&lt;p&gt;Audifire: Created page with &amp;quot;__NOTOC__  {{Server client function}}  This function will create a reference to the given argument.  ==Syntax==  &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int ref( mixed objectToReference...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}} &lt;br /&gt;
This function will create a reference to the given argument.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int ref( mixed objectToReference )    &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''objectToReference :''' The Lua element, which you want to reference&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an ''int'' if the reference were successfully created. Returns ''false'' if the parameter were invalid.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Utility_functions&amp;diff=65847</id>
		<title>Template:Utility functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Utility_functions&amp;diff=65847"/>
		<updated>2020-04-13T23:47:10Z</updated>

		<summary type="html">&lt;p&gt;Audifire: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[addDebugHook]]&lt;br /&gt;
*[[base64Decode]]&lt;br /&gt;
*[[base64Encode]]&lt;br /&gt;
{{Bit_functions}}&lt;br /&gt;
*[[debugSleep]]&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
*[[decodeString]]&lt;br /&gt;
|11849}}&lt;br /&gt;
*[[deref]]&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
*[[encodeString]]&lt;br /&gt;
|11849}}&lt;br /&gt;
*[[fromJSON]]&lt;br /&gt;
*[[getColorFromString]]&lt;br /&gt;
*[[getDevelopmentMode]]&lt;br /&gt;
*[[getDistanceBetweenPoints2D]]&lt;br /&gt;
*[[getDistanceBetweenPoints3D]]&lt;br /&gt;
*[[getEasingValue]]&lt;br /&gt;
*[[getFPSLimit]]&lt;br /&gt;
*[[getNetworkStats]]&lt;br /&gt;
*[[getNetworkUsageData]]&lt;br /&gt;
*[[getPerformanceStats]]&lt;br /&gt;
*[[getRealTime]]&lt;br /&gt;
*[[getServerConfigSetting]]&lt;br /&gt;
*[[getTickCount]]&lt;br /&gt;
*[[getTimerDetails]]&lt;br /&gt;
*[[getTimers]]&lt;br /&gt;
*[[gettok]]&lt;br /&gt;
*[[getUserdataType]]&lt;br /&gt;
*[[getVersion]]&lt;br /&gt;
*[[hash]]&lt;br /&gt;
*[[inspect]]&lt;br /&gt;
*[[interpolateBetween]]&lt;br /&gt;
*[[iprint]]&lt;br /&gt;
*[[isOOPEnabled]]&lt;br /&gt;
*[[isTimer]]&lt;br /&gt;
*[[killTimer]]&lt;br /&gt;
*[[md5]]&lt;br /&gt;
*[[passwordHash]]&lt;br /&gt;
*[[passwordVerify]]&lt;br /&gt;
*[[pregFind]]&lt;br /&gt;
*[[pregMatch]]&lt;br /&gt;
*[[pregReplace]]&lt;br /&gt;
*[[removeDebugHook]]&lt;br /&gt;
*[[ref]]&lt;br /&gt;
*[[resetTimer]]&lt;br /&gt;
*[[setDevelopmentMode]]&lt;br /&gt;
*[[setFPSLimit]]&lt;br /&gt;
*[[setServerConfigSetting]]&lt;br /&gt;
*[[setTimer]]&lt;br /&gt;
*[[sha256]]&lt;br /&gt;
*[[split]]&lt;br /&gt;
*[[teaDecode]]&lt;br /&gt;
*[[teaEncode]]&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
*[[tocolor]]&lt;br /&gt;
|13977}}&lt;br /&gt;
*[[toJSON]]&lt;br /&gt;
*[[utfChar]]&lt;br /&gt;
*[[utfCode]]&lt;br /&gt;
*[[utfLen]]&lt;br /&gt;
*[[utfSeek]]&lt;br /&gt;
*[[utfSub]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetDebugViewActive&amp;diff=50777</id>
		<title>SetDebugViewActive</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetDebugViewActive&amp;diff=50777"/>
		<updated>2017-04-22T20:03:14Z</updated>

		<summary type="html">&lt;p&gt;Audifire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function enables or disables the debug window.&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 setDebugViewActive ( bool enabled )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''enabled:''' true if debug window should be visible, false otherwise.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'', ''false'' if invalid parameters are passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example enables or disables the debug window.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function enableDebug()&lt;br /&gt;
	local state = not isDebugViewActive()&lt;br /&gt;
	setDebugViewActive(state)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;debug&amp;quot;, enableDebug)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=InjectBrowserMouseWheel&amp;diff=45498</id>
		<title>InjectBrowserMouseWheel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=InjectBrowserMouseWheel&amp;diff=45498"/>
		<updated>2015-07-26T01:46:56Z</updated>

		<summary type="html">&lt;p&gt;Audifire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client_function}}&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
This function injects mouse wheel events. &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 injectBrowserMouseWheel ( browser webBrowser, int verticalScroll, int horizontalScroll )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:injectMouseWheel||injectBrowserMouseWheel}}&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''webBrowser:''' The web browser&lt;br /&gt;
*'''verticalScroll''': Amount of units you want the browser to scroll along the Y-axe.&lt;br /&gt;
*'''horizontalScroll''': Amount of units you want the browser to scroll along the X-axe.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the mouse action was successfully injected, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local webBrowser = createBrowser(1000, 1000, false, false)&lt;br /&gt;
showCursor(true)&lt;br /&gt;
&lt;br /&gt;
function webBrowserRender()&lt;br /&gt;
        dxDrawImage(0, 0, 1000, 1000, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webBrowser,&lt;br /&gt;
        function()&lt;br /&gt;
              loadBrowserURL(webBrowser, &amp;quot;https://www.youtube.com/tv#/watch?mode=transport&amp;amp;v=jofNR_WkoCE&amp;quot;)&lt;br /&gt;
              addEventHandler(&amp;quot;onClientRender&amp;quot;, root, webBrowserRender)&lt;br /&gt;
              addEventHandler(&amp;quot;onClientKey&amp;quot;, root, onKey)&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
function onKey(button)&lt;br /&gt;
	if button == &amp;quot;mouse_wheel_down&amp;quot; then&lt;br /&gt;
		injectBrowserMouseWheel(webBrowser, -40, 0)&lt;br /&gt;
	elseif button == &amp;quot;mouse_wheel_up&amp;quot; then&lt;br /&gt;
		injectBrowserMouseWheel(webBrowser, 40, 0)&lt;br /&gt;
	end&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{CEF_functions}}&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=InjectBrowserMouseWheel&amp;diff=45497</id>
		<title>InjectBrowserMouseWheel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=InjectBrowserMouseWheel&amp;diff=45497"/>
		<updated>2015-07-26T01:46:33Z</updated>

		<summary type="html">&lt;p&gt;Audifire: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client_function}}&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
This function injects mouse wheel events. &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 injectBrowserMouseWheel ( browser webBrowser, int verticalScroll, int horizontalScroll )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Element/Browser|browser]]:injectMouseWheel||injectBrowserMouseWheel}}&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''webBrowser:''' The web browser&lt;br /&gt;
*'''verticalScroll''': Amount of units you want the browser to scroll along the Y-axe.&lt;br /&gt;
*'''horizontalScroll''': Amount of units you want the browser to scroll along the X-axe.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the mouse action was successfully injected, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;local webBrowser = createBrowser(1000, 1000, false, false)&lt;br /&gt;
showCursor(true)&lt;br /&gt;
&lt;br /&gt;
function webBrowserRender()&lt;br /&gt;
        dxDrawImage(0, 0, 1000, 1000, webBrowser, 0, 0, 0, tocolor(255,255,255,255), true)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientBrowserCreated&amp;quot;, webBrowser,&lt;br /&gt;
        function()&lt;br /&gt;
              loadBrowserURL(webBrowser, &amp;quot;https://www.youtube.com/tv#/watch?mode=transport&amp;amp;v=jofNR_WkoCE&amp;quot;)&lt;br /&gt;
              addEventHandler(&amp;quot;onClientRender&amp;quot;, root, webBrowserRender)&lt;br /&gt;
              addEventHandler(&amp;quot;onClientKey&amp;quot;, root, onKey)&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
function onKey(button)&lt;br /&gt;
	if button == &amp;quot;mouse_wheel_down&amp;quot; then&lt;br /&gt;
		injectBrowserMouseWheel(webbrowser, -40, 0)&lt;br /&gt;
	elseif button == &amp;quot;mouse_wheel_up&amp;quot; then&lt;br /&gt;
		injectBrowserMouseWheel(webbrowser, 40, 0)&lt;br /&gt;
	end&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
Todo&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{CEF_functions}}&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=45335</id>
		<title>ToJSON</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=45335"/>
		<updated>2015-06-11T21:38:35Z</updated>

		<summary type="html">&lt;p&gt;Audifire: /* Optional Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0120|1.2||&lt;br /&gt;
Available client side in 1.2 and onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This function converts a '''single''' value (preferably a Lua table) into a [[JSON]] encoded string. You can use this to store the data and then load it again using [[fromJSON]].&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string toJSON ( var value, [ bool compact = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''var:''' An argument of any type. Arguments that are elements will be stored as element IDs that are liable to change between sessions. As such, do not save elements across sessions as you will get unpredictable results.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
*'''compact:''' a [[boolean]] representing whether the string will contain whitespaces. To remove whitespaces from JSON string, use ''true''. String will contain whitespaces per default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a JSON formatted string.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example shows how you can encode an array. The string json should equal ''&amp;quot;[ { &amp;quot;1&amp;quot;: &amp;quot;dogs&amp;quot;, &amp;quot;mouse&amp;quot;: &amp;quot;food&amp;quot;, &amp;quot;cat&amp;quot;: &amp;quot;hungry&amp;quot;, &amp;quot;birds&amp;quot;: 4 } ]&amp;quot; after executed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local json = toJSON ( { &amp;quot;dogs&amp;quot;, cat = &amp;quot;hungry&amp;quot;, mouse = &amp;quot;food&amp;quot;, birds = 4 } )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.0|1.1.1-9.03316|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server_functions}}&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=45334</id>
		<title>ToJSON</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=45334"/>
		<updated>2015-06-11T21:37:39Z</updated>

		<summary type="html">&lt;p&gt;Audifire: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|3.0120|1.2||&lt;br /&gt;
Available client side in 1.2 and onwards.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This function converts a '''single''' value (preferably a Lua table) into a [[JSON]] encoded string. You can use this to store the data and then load it again using [[fromJSON]].&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;!-- NOTE: don't use 'special' names for variable names, e.g. you shouldn't be writing things like 'player player, vehicle vehicle', instead write something like 'player thePlayer, vehicle vehicleToGetInto'. This is less confusing and prevents the syntax highlighting being odd --&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string toJSON ( var value, [ bool compact = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''var:''' An argument of any type. Arguments that are elements will be stored as element IDs that are liable to change between sessions. As such, do not save elements across sessions as you will get unpredictable results.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
*'''compact:''' a [[boolean]] representing whether the string will contain whitespaces. To remove whitespaces from JSON stirng, use ''true''. String will contain whitespaces per default.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a JSON formatted string.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example shows how you can encode an array. The string json should equal ''&amp;quot;[ { &amp;quot;1&amp;quot;: &amp;quot;dogs&amp;quot;, &amp;quot;mouse&amp;quot;: &amp;quot;food&amp;quot;, &amp;quot;cat&amp;quot;: &amp;quot;hungry&amp;quot;, &amp;quot;birds&amp;quot;: 4 } ]&amp;quot; after executed.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local json = toJSON ( { &amp;quot;dogs&amp;quot;, cat = &amp;quot;hungry&amp;quot;, mouse = &amp;quot;food&amp;quot;, birds = 4 } )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.0|1.1.1-9.03316|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Server_functions}}&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=45231</id>
		<title>PlaySound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=45231"/>
		<updated>2015-05-25T11:36:15Z</updated>

		<summary type="html">&lt;p&gt;Audifire: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a [[sound]] [[element]] in the GTA world and plays it immediately after creation for the local player. [[setElementPosition]] can be used to move the [[sound]] element around after it has been created. Remember to use [[setElementDimension]] after creating the sound to play it outside of dimension 0.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note:''' The only supported audio formats are MP3, WAV, OGG, RIFF, MOD, XM, IT and S3M.&lt;br /&gt;
{{Note|For performance reasons, when using playSound3D for effects that will be played lots (i.e. weapon fire), it is recommend that you convert your audio file to a one channel (mono) WAV with sample rate of 22050 Hz or less. Also consider adding a limit on how often the effect can be played e.g. once every 50ms.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound3D ( string soundPath, float x, float y, float z, [ bool looped = false, bool throttled = true ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Sound|Sound3D]].create}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' the [[filepath]] to the sound file you want to play. (Sound file has to be predefined in the [[meta.xml]] file with &amp;lt;file /&amp;gt; tag. And also can use url instead of [[filepath]] )&lt;br /&gt;
*'''x:''' a [[float]]ing point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' a [[float]]ing point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' a [[float]]ing point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' A [[boolean]] representing whether the sound will be looped. To loop the sound, use ''true''.&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
*'''throttled:''' a [[boolean]] representing whether the sound will be throttled. To throttle the sound, use ''true''. Sounds will be throttled per default and only for URLs.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[sound]] [[element]] if the sound was successfully created, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a looping sound within a pizza shop. The pizza shop is in san fierro near pier 69&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&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 onResourceStart()&lt;br /&gt;
	local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true) &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(), onResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example play internet radio in groove street.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&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;
addEventHandler( 'onClientResourceStart', resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		local uSound = playSound3D( 'http://193.34.51.25:80', 2498, -1659, 12 ) &lt;br /&gt;
		setSoundMaxDistance( uSound, 100 )&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:playSound3D]]&lt;br /&gt;
[[DE:playSound3D]]&lt;br /&gt;
[[RU:playSound3D]]&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=45230</id>
		<title>PlaySound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=45230"/>
		<updated>2015-05-25T11:35:46Z</updated>

		<summary type="html">&lt;p&gt;Audifire: /* Optional Arguments */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a [[sound]] [[element]] in the GTA world and plays it immediately after creation for the local player. [[setElementPosition]] can be used to move the [[sound]] element around after it has been created. Remember to use [[setElementDimension]] after creating the sound to play it outside of dimension 0.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note:''' The only supported audio formats are MP3, WAV, OGG, RIFF, MOD, XM, IT and S3M.&lt;br /&gt;
{{Note|For performance reasons, when using playSound3D for effects that will be played lots (i.e. weapon fire), it is recommend that you convert your audio file to a one channel (mono) WAV with sample rate of 22050 Hz or less. Also consider adding a limit on how often the effect can be played e.g. once every 50ms.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound3D ( string soundPath, float x, float y, float z, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Sound|Sound3D]].create}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' the [[filepath]] to the sound file you want to play. (Sound file has to be predefined in the [[meta.xml]] file with &amp;lt;file /&amp;gt; tag. And also can use url instead of [[filepath]] )&lt;br /&gt;
*'''x:''' a [[float]]ing point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' a [[float]]ing point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' a [[float]]ing point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' A [[boolean]] representing whether the sound will be looped. To loop the sound, use ''true''.&lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
*'''throttled:''' a [[boolean]] representing whether the sound will be throttled. To throttle the sound, use ''true''. Sounds will be throttled per default and only for URLs.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[sound]] [[element]] if the sound was successfully created, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a looping sound within a pizza shop. The pizza shop is in san fierro near pier 69&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&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 onResourceStart()&lt;br /&gt;
	local sound = playSound3D(&amp;quot;sounds/song.mp3&amp;quot;, 373.14, -125.21, 1001, true) &lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(), onResourceStart)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
This example play internet radio in groove street.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&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;
addEventHandler( 'onClientResourceStart', resourceRoot,&lt;br /&gt;
	function( )&lt;br /&gt;
		local uSound = playSound3D( 'http://193.34.51.25:80', 2498, -1659, 12 ) &lt;br /&gt;
		setSoundMaxDistance( uSound, 100 )&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:playSound3D]]&lt;br /&gt;
[[DE:playSound3D]]&lt;br /&gt;
[[RU:playSound3D]]&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=45197</id>
		<title>PlaySound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=45197"/>
		<updated>2015-05-10T22:04:02Z</updated>

		<summary type="html">&lt;p&gt;Audifire: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Creates a [[sound]] [[element]] and plays it immediately after creation for the local player.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note:''' The only supported audio formats are MP3, WAV, OGG, RIFF, MOD, XM, IT, S3M and PLS(e.g. Webstream).&lt;br /&gt;
{{Note|For performance reasons, when using playSound for effects that will be played lots (i.e. weapon fire), it is recommend that you convert your audio file to a one channel (mono) WAV with sample rate of 22050 Hz or less. Also consider adding a limit on how often the effect can be played e.g. once every 50ms.}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound ( string soundPath, [ bool looped = false ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound ( string soundPath, [ bool looped = false, [ bool throttled = true ] ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
}}&lt;br /&gt;
{{OOP||[[Sound]].create}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' the [[filepath]] or URL of the sound file you want to play. (Sound specified by filepath has to be predefined in the [[meta.xml]] file with &amp;lt;file /&amp;gt; tag.)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''looped:''' a [[boolean]] representing whether the sound will be looped. To loop the sound, use ''true''. Loop is not available for streaming sounds, only for sound files.&lt;br /&gt;
*'''throttled:''' a [[boolean]] representing whether the sound will be throttled. To throttle the sound, use ''true''. Sounds will be throttled per default and only for URLs.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[sound]] [[element]] if the sound was successfully created, ''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;
function wasted (killer, weapon, bodypart) &lt;br /&gt;
	local sound = playSound(&amp;quot;sounds/wasted.mp3&amp;quot;) --Play wasted.mp3 from the sounds folder&lt;br /&gt;
	setSoundVolume(sound, 0.5) -- set the sound volume to 50%&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWasted&amp;quot;, getLocalPlayer(), wasted) --add the event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
[[AR:playSound]]&lt;br /&gt;
[[DE:playSound]]&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_event_functions&amp;diff=36552</id>
		<title>Template:Client event functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_event_functions&amp;diff=36552"/>
		<updated>2013-07-06T17:42:23Z</updated>

		<summary type="html">&lt;p&gt;Audifire: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[addEvent]]&lt;br /&gt;
* [[addEventHandler]]&lt;br /&gt;
{{New feature/item|4.0140|1.4|4973|&lt;br /&gt;
* [[getEventHandlers]]&lt;br /&gt;
}}&lt;br /&gt;
* [[cancelEvent]]&lt;br /&gt;
* [[removeEventHandler]]&lt;br /&gt;
* [[triggerEvent]]&lt;br /&gt;
* [[triggerServerEvent]]&lt;br /&gt;
* [[wasEventCancelled]]&lt;br /&gt;
* [[triggerLatentServerEvent]]&lt;br /&gt;
* [[getLatentEventHandles]]&lt;br /&gt;
* [[getLatentEventStatus]]&lt;br /&gt;
* [[cancelLatentEvent]]&lt;/div&gt;</summary>
		<author><name>Audifire</name></author>
	</entry>
</feed>