<?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=-ffs-Sniper</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=-ffs-Sniper"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/-ffs-Sniper"/>
	<updated>2026-05-14T10:21:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=65964</id>
		<title>PlaySound3D</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound3D&amp;diff=65964"/>
		<updated>2020-04-22T15:01:18Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Added info about supported URL protocols, especially ftp://&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|&lt;br /&gt;
*The only supported audio formats are MP3, WAV, OGG, RIFF, MOD, XM, IT and S3M.&lt;br /&gt;
*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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;element playSound3D ( string soundURL, float x, float y, float z, [ bool looped = false, bool throttled = true ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Sound|Sound3D]]}}&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''soundPath:''' the [[filepath]] to the sound file you want to play. ('''Note:''' Playing sound files from other resources requires the target resource to be in the running state)&lt;br /&gt;
*'''soundURL:''' the URL (http://, https:// or ftp://) of the sound file you want to play. (In this version the file does not have to be predefined in the [[meta.xml]])&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 (i.e. given reduced download bandwidth). To throttle the sound, use ''true''.&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;, resourceRoot, 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://977music.com/itunes/80s.pls', 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;
[[HU:playSound3D]]&lt;br /&gt;
[[AR:playSound3D]]&lt;br /&gt;
[[DE:playSound3D]]&lt;br /&gt;
[[RU:playSound3D]]&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=65955</id>
		<title>PlaySound</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=PlaySound&amp;diff=65955"/>
		<updated>2020-04-22T14:54:20Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: add info about supported URL protocols, especially ftp://&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|&lt;br /&gt;
*The only supported audio formats are MP3, WAV, OGG, RIFF, MOD, XM, IT, S3M and PLS (e.g. Webstream).&lt;br /&gt;
*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, bool throttled = true ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Sound]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''soundPath:''' the [[filepath]] or URL (http://, https:// or ftp://) of the sound file you want to play. ('''Note:''' Playing sound files from other resources requires the target resource to be in the running state)&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;
{{New feature/item|3.0150|1.5||&lt;br /&gt;
*'''throttled:''' a [[boolean]] representing whether the sound will be throttled (i.e. given reduced download bandwidth). 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;
&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;, localPlayer, 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;
[[HU:playSound]]&lt;br /&gt;
[[AR:playSound]]&lt;br /&gt;
[[DE:playSound]]&lt;br /&gt;
[[RO:playSound]]&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=65949</id>
		<title>User:-ffs-Sniper</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=65949"/>
		<updated>2020-04-22T10:06:51Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: self update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome, ==&lt;br /&gt;
&lt;br /&gt;
my name is -ffs-Sniper, leader at the FFS Gaming community with its innovative multigamemode server.&lt;br /&gt;
&lt;br /&gt;
Some folks might remember me as a former leader of the &amp;quot;Small Hustlers Crew&amp;quot; clan in 2009-2011 and former contributor to the MTA DayZ gamemode.&lt;br /&gt;
&lt;br /&gt;
== Current projects: ==&lt;br /&gt;
&lt;br /&gt;
http://ffs.gg/ (Leader - Head of Community)&lt;br /&gt;
&lt;br /&gt;
== Source patches: ==&lt;br /&gt;
&lt;br /&gt;
 -https://github.com/multitheftauto/mtasa-blue/commit/522b83efc78f23210dfde1acaeeab8cc4e545c1f&lt;br /&gt;
&lt;br /&gt;
See my wiki contributions [http://wiki.multitheftauto.com/wiki/Special:Contributions/-ffs-Sniper here].&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=39131</id>
		<title>User:-ffs-Sniper</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=39131"/>
		<updated>2014-03-19T22:52:49Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: spring cleaning&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome, ==&lt;br /&gt;
&lt;br /&gt;
I am -ffs-Sniper, leader of the |FFS|Gaming community playing race gamemodes on an innovative multimode server.&lt;br /&gt;
&lt;br /&gt;
Most people might remember me as SHC//Sniper, the former founder and leader of the &amp;quot;Small Hustlers Crew&amp;quot; clan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current projects: ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://ffsgaming.net/ (leader and developer)&lt;br /&gt;
&lt;br /&gt;
http://mtadayz.net/ (MTA:DayZ gamemode developer)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source patches: ==&lt;br /&gt;
&lt;br /&gt;
 -http://code.google.com/p/mtasa-blue/source/detail?r=3909&lt;br /&gt;
&lt;br /&gt;
See my wiki contributions [http://wiki.multitheftauto.com/wiki/Special:Contributions/-ffs-Sniper here].&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=35496</id>
		<title>User:-ffs-Sniper</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=35496"/>
		<updated>2013-04-19T21:45:50Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Updated my page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Welcome, ==&lt;br /&gt;
&lt;br /&gt;
I am -ffs-Sniper, leader of the famous |FFS|Gaming community.&lt;br /&gt;
Most people know might remember me as SHC//Sniper, the former founder and leader of the SHC clan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Current projects: ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
http://ffsgaming.net (leader and developer)&lt;br /&gt;
&lt;br /&gt;
http://community.vavegames.net/ (MTA:DayZ gamemode developer)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source patches: ==&lt;br /&gt;
&lt;br /&gt;
 -http://code.google.com/p/mtasa-blue/source/detail?r=3909&lt;br /&gt;
&lt;br /&gt;
See my wiki contributions [http://wiki.multitheftauto.com/wiki/Special:Contributions/-ffs-Sniper here].&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=34969</id>
		<title>ToJSON</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=34969"/>
		<updated>2013-02-18T20:04:44Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &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;
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 )&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;
===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>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreatePed&amp;diff=32884</id>
		<title>CreatePed</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreatePed&amp;diff=32884"/>
		<updated>2012-08-26T21:54:05Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Corrected meaning of the servers-side &amp;quot;synced&amp;quot; argument&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
Creates a Ped in the GTA world.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool synced = true ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''rot:''' A floating point number representing the rotation in degrees. &lt;br /&gt;
*'''synced:''' A boolean value representing whether or not the ped will be synced. Disabling the sync might be useful for frozen or static peds to increase the server performance.&lt;br /&gt;
&amp;lt;/section&amp;gt;&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;ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''rot:''' A floating point number representing the rotation in degrees. &lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ped element if it was successfully created.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&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 creates an ped when the resource starts:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function pedLoad ( name )&lt;br /&gt;
   createPed ( 120, 5540.6654, 1020.55122, 1240.545 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement(), pedLoad )&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;
{{Ped functions}}&lt;br /&gt;
[[ru:createPed]]&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=32883</id>
		<title>User:-ffs-Sniper</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=32883"/>
		<updated>2012-08-26T21:45:18Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome,&lt;br /&gt;
I am -ffs-Sniper, leader of the famous |FFS|Gaming community.&lt;br /&gt;
Most people know me as SHC//Sniper, the former founder and leader of the SHC clan.&lt;br /&gt;
&lt;br /&gt;
Source patches:&lt;br /&gt;
 -http://code.google.com/p/mtasa-blue/source/detail?r=3909&lt;br /&gt;
&lt;br /&gt;
See my contributions [http://wiki.multitheftauto.com/wiki/Special:Contributions/-ffs-Sniper here].&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleIdleRespawnDelay&amp;diff=32882</id>
		<title>SetVehicleIdleRespawnDelay</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleIdleRespawnDelay&amp;diff=32882"/>
		<updated>2012-08-26T21:43:11Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: /* Example */ Fixed example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function sets the time delay (in milliseconds) the vehicle will remain at its position while empty.&lt;br /&gt;
{{Important Note|[[toggleVehicleRespawn]] must be set to true for this function to have any effect}} &lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setVehicleIdleRespawnDelay ( vehicle theVehicle, int timeDelay )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': The [[vehicle]] you wish to change the respawn delay of.&lt;br /&gt;
*'''timeDelay''': The number of milliseconds the vehicle will be allowed to remain unused until it respawns.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns ''true'' if the vehicle was found and edited.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example creates a vehicle and sets its respawn delay to 20 seconds.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
theVehicle = createVehicle ( 400, 1, 1, 1 )       -- create us a new vehicle&lt;br /&gt;
if ( theVehicle ) then&lt;br /&gt;
    toggleVehicleRespawn ( theVehicle, true ) -- enable vehicle respawn as it is necessary for the idle respawn to function&lt;br /&gt;
    setVehicleIdleRespawnDelay ( theVehicle, 20000 ) -- tell the server to respawn the vehicle 20 seconds after it's been left.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateResource&amp;diff=30927</id>
		<title>CreateResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateResource&amp;diff=30927"/>
		<updated>2012-05-19T10:55:17Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: fixed my last revision&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function creates an new, empty resource. This creates a directory matching the name you specify on disk, then creates an empty meta.xml file with a &amp;lt;meta&amp;gt; element in it. &lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource createResource ( string resourceName [, string organizationalDir ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' The name of the new resource. This should be a valid file name. It's recommended that you do not have spaces or non-ASCII characters in resource names.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''organizationalDir''': A string containing the path where the resource should be created (e.g. &amp;quot;[gamemodes]/[amx]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [[resource]] element of the new resource if successful, ''false'' otherwise. This could fail if the resource name already is in use, if a directory already exists with the name you've specified (but this isn't a valid resource) or if the name you specify isn't valid. It could also fail if the disk was full or for other similar reasons.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a new resource named what the player specified. The command is &amp;quot;/new-resource &amp;lt;name&amp;gt;&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createNewResource ( source, command, resourceName ) -- Define the source and add a resourceName argument.&lt;br /&gt;
	if ( resourceName ) then -- Check if they entered a resource name, and if they did...&lt;br /&gt;
		local resourceName = tostring ( resourceName ) -- Convert the name into a string.&lt;br /&gt;
		local newResource = createResource ( resourceName ) -- Create the new resource.&lt;br /&gt;
			if ( newResource ) then -- Check if the resource has been created, if so then...&lt;br /&gt;
				outputChatBox ( &amp;quot;New resource created succcessfully.&amp;quot;, source, 255, 0, 0 ) -- Output it's done.&lt;br /&gt;
			else -- If the resource wasn't made successfully then...&lt;br /&gt;
				outputChatBox ( &amp;quot;An un-expected error occured.&amp;quot;, source, 255, 0, 0 ) -- Output it failed.&lt;br /&gt;
			end&lt;br /&gt;
	else -- If they didn't enter a resource name...&lt;br /&gt;
		outputChatBox ( &amp;quot;Please specify a name for your new resource.&amp;quot;, source, 255, 0, 0 ) -- Tell them to specify a name.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;new-resource&amp;quot;, createNewResource ) -- Make it trigger when somebody types &amp;quot;/new-resource &amp;lt;name&amp;gt;&amp;quot;.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateResource&amp;diff=30926</id>
		<title>CreateResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateResource&amp;diff=30926"/>
		<updated>2012-05-19T10:13:27Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function creates an new, empty resource. This creates a directory matching the name you specify on disk, then creates an empty meta.xml file with a &amp;lt;meta&amp;gt; element in it. &lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource createResource ( string resourceName [, string organizationalDir ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' The name of the new resource. This should be a valid file name. It's recommended that you do not have spaces or non-ASCII characters in resource names.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''organizationalDir''': A string containing the path where the resource should be created (e.g. &amp;quot;[gamemodes]/[amx]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been created successfully, ''false'' otherwise. This could fail if the resource name already is in use, if a directory already exists with the name you've specified (but this isn't a valid resource) or if the name you specify isn't valid. It could also fail if the disk was full or for other similar reasons.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a new resource named what the player specified. The command is &amp;quot;/new-resource &amp;lt;name&amp;gt;&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createNewResource ( source, command, resourceName ) -- Define the source and add a resourceName argument.&lt;br /&gt;
	if ( resourceName ) then -- Check if they entered a resource name, and if they did...&lt;br /&gt;
		local resourceName = tostring ( resourceName ) -- Convert the name into a string.&lt;br /&gt;
		local newResource = createResource ( resourceName ) -- Create the new resource.&lt;br /&gt;
			if ( newResource ) then -- Check if the resource has been created, if so then...&lt;br /&gt;
				outputChatBox ( &amp;quot;New resource created succcessfully.&amp;quot;, source, 255, 0, 0 ) -- Output it's done.&lt;br /&gt;
			else -- If the resource wasn't made successfully then...&lt;br /&gt;
				outputChatBox ( &amp;quot;An un-expected error occured.&amp;quot;, source, 255, 0, 0 ) -- Output it failed.&lt;br /&gt;
			end&lt;br /&gt;
	else -- If they didn't enter a resource name...&lt;br /&gt;
		outputChatBox ( &amp;quot;Please specify a name for your new resource.&amp;quot;, source, 255, 0, 0 ) -- Tell them to specify a name.&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;new-resource&amp;quot;, createNewResource ) -- Make it trigger when somebody types &amp;quot;/new-resource &amp;lt;name&amp;gt;&amp;quot;.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=30070</id>
		<title>ToJSON</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=30070"/>
		<updated>2012-04-25T23:26:06Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Small fixes&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;
This function converts '''one''' variable (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 )&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;
===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>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=29825</id>
		<title>User:-ffs-Sniper</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=29825"/>
		<updated>2012-03-31T22:36:35Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome, this is -ffs-Sniper, co leader of the |FFS|Gaming community, No 1 in DD/DM racing.&lt;br /&gt;
Most people know me as SHC//Sniper, the former founder and leader of the SHC clan.&lt;br /&gt;
&lt;br /&gt;
Source patches:&lt;br /&gt;
 -http://code.google.com/p/mtasa-blue/source/detail?r=3909&lt;br /&gt;
&lt;br /&gt;
See my contributions [http://wiki.multitheftauto.com/wiki/Special:Contributions/-ffs-Sniper here].&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User_talk:X86dev&amp;diff=29823</id>
		<title>User talk:X86dev</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User_talk:X86dev&amp;diff=29823"/>
		<updated>2012-03-31T21:18:02Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Question&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cmon x86, not all scripters knew that about setGameSpeed. Why to delete it? Was it specified somewhere else or what? --[[User:The Kid|Benxamix2]] 20:10, 16 November 2011 (CET)&lt;br /&gt;
&lt;br /&gt;
: It's rather obvious and applies to every function that is implemented both server- and client-side. --[[User:Wielebny|Wielebny]] 03:51, 17 November 2011 (CET)&lt;br /&gt;
&lt;br /&gt;
Why did you undo my revision 29816 of createPed? The arguments name is bSynced in the source code while the &amp;quot;b&amp;quot; indicates the type of the argument, a boolean. The &amp;quot;b&amp;quot; is not necessary since the type of the argument is already determined in the syntax. The real LUA name should be &amp;quot;synced&amp;quot;. --[[User:-ffs-Sniper|-ffs-Sniper]] 21:18, 31 March 2012 (UTC)&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreatePed&amp;diff=29816</id>
		<title>CreatePed</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreatePed&amp;diff=29816"/>
		<updated>2012-03-30T22:19:20Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: small fix for the syntax: bSynced -&amp;gt; synced&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Needs_Checking|Please check if I'm right with the synced argument. I've been testing two different peds and discovered the effect described below --[[User:OpenIDUser28|Sniper]] 03:12, 4 September 2011 (CEST)}} &lt;br /&gt;
Creates a Ped in the GTA world.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&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;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0, bool synced = true ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''rot:''' A floating point number representing the rotation in degrees. &lt;br /&gt;
*'''synced:''' A boolean value representing whether or not the ped will be fully synchronized even for players that are not within the syncing range. If disabled a player that is more than 100 units away from the ped won't receive any new information about its state and position. This will cause a desync of the ped (useful for frozen/static peds to increase the server perfomance).&lt;br /&gt;
&amp;lt;/section&amp;gt;&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;ped createPed ( int modelid, float x, float y, float z [, float rot = 0.0 ] )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modelid:''' A whole integer specifying the [[Character_Skins|GTASA skin ID]].&lt;br /&gt;
*'''x:''' A floating point number representing the X coordinate on the map.&lt;br /&gt;
*'''y:''' A floating point number representing the Y coordinate on the map.&lt;br /&gt;
*'''z:''' A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
==Optional Arguments==&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''rot:''' A floating point number representing the rotation in degrees. &lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ped element if it was successfully created.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&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 creates an ped when the resource starts:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function pedLoad ( name )&lt;br /&gt;
   createPed ( 120, 5540.6654, 1020.55122, 1240.545 )&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement(), pedLoad )&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;
{{Ped functions}}&lt;br /&gt;
[[ru:createPed]]&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FromJSON&amp;diff=29771</id>
		<title>FromJSON</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FromJSON&amp;diff=29771"/>
		<updated>2012-03-29T19:39:26Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Removed &amp;quot;Needs Checking&amp;quot;, fixed example&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;
This function parses a [[JSON]] formatted string into variables. You can use [[toJSON]] to encode variables into a JSON string that can be read by this function.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var fromJSON ( string json )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''json:''' A JSON formatted string&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns variables read from the JSON string.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Indices of a JSON object such as &amp;quot;1&amp;quot;: &amp;quot;cat&amp;quot; are being returned as [[string]], not as [[int]]eger.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This makes data equal: ''{ [&amp;quot;1&amp;quot;] = &amp;quot;cat&amp;quot;, [&amp;quot;2&amp;quot;] = &amp;quot;mouse&amp;quot;, [&amp;quot;3&amp;quot;] = 5, [&amp;quot;4&amp;quot;] = null, [&amp;quot;cat&amp;quot;] = 5, [&amp;quot;mouse&amp;quot;] =1 }''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local data = fromJSON ( '[ { &amp;quot;1&amp;quot;: &amp;quot;cat&amp;quot;, &amp;quot;2&amp;quot;: &amp;quot;mouse&amp;quot;, &amp;quot;3&amp;quot;: 5, &amp;quot;4&amp;quot;: null, &amp;quot;cat&amp;quot;:5, &amp;quot;mouse&amp;quot;:1 } ]' )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example 2==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local name, weapon, ammo = fromJSON(&amp;quot;[\&amp;quot;Desert Eagle\&amp;quot;, 24, 147]&amp;quot;)&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>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_Manual&amp;diff=29770</id>
		<title>Server Manual</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_Manual&amp;diff=29770"/>
		<updated>2012-03-29T19:03:06Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Undo revision 29767 by Khtsjefen (talk) Grammar, broken link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
==Getting started==&lt;br /&gt;
It is much easier than it looks to get a server up and running for your internet or LAN buddies; follow this wiki article and you will hopefully be on your way to hosting your own MTA:SA server in no time!&lt;br /&gt;
&lt;br /&gt;
==Installing the server==&lt;br /&gt;
The dedicated server application is available in different flavours depending on the platform of the server.&lt;br /&gt;
&lt;br /&gt;
===Linux installation===&lt;br /&gt;
There are different ways of getting a Linux server up and running:&lt;br /&gt;
* [[Building MTASA Server on GNU Linux]]&lt;br /&gt;
* [http://linux.mtasa.com Getting a precompiled package]&lt;br /&gt;
&lt;br /&gt;
===Windows installation===&lt;br /&gt;
Installation of the MTA:SA server on Windows is easy as pie.&lt;br /&gt;
*Go to the [http://mtasa.com/ download page] and download the installer.&lt;br /&gt;
*Once the installer is downloaded, open it.&lt;br /&gt;
*Select a folder where you want to install the server.&lt;br /&gt;
*Click Install.&lt;br /&gt;
*Done!&lt;br /&gt;
&lt;br /&gt;
''For a full explanation of acl.xml (access control list) read: [[Access_Control_List|Access Control List]]''&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuring your server==&lt;br /&gt;
The Multi Theft Auto dedicated server is initially configurable through it's console window, from within the game, and from a webbrowser. In order to make use of the two last options, it is necessary to add at least one administrator user to your configuration file.&lt;br /&gt;
&lt;br /&gt;
===General configuration===&lt;br /&gt;
All general configuration options can be found in the 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' file and can be opened by any regular text editor.&lt;br /&gt;
&lt;br /&gt;
This file is fairly straightforward; every variable has a [[Server_mtaserver.conf|description of what to do with it and how to change it]].&lt;br /&gt;
&lt;br /&gt;
===Port forwarding===&lt;br /&gt;
If you run your server on your own private computer, and you have an router between the internet and your computer. You need to forward 3 ports.&lt;br /&gt;
&lt;br /&gt;
First of all open the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' and search for the next lines:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;serverport&amp;gt;22004&amp;lt;/serverport&amp;gt; &lt;br /&gt;
&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ports are needed to setup the server correctly. We explain later how to set them, but first if you want your server to appear in the server browser there is another port we need, and that is the ASE port. &lt;br /&gt;
(quick example for how to turn ASE on or off):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt; &amp;lt;!-- 0 = off, 1 = on --&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we going to forward the ports in your router, which is not needed if you already have all ports open, or if you don't have a router with a firewall. If so, skip this part.&lt;br /&gt;
&lt;br /&gt;
If you don't know how port forwarding works in your router, go to the [http://portforward.com/ Port Forward website], find your router model there, and follow the instructions there.&lt;br /&gt;
&lt;br /&gt;
In almost every router you can set the port type: UDP or TCP. The following list will explain which port type is needed for what:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Main server port: UDP&lt;br /&gt;
&lt;br /&gt;
HTTP Port: TCP&lt;br /&gt;
&lt;br /&gt;
ASE Port: UDP (this is needed if you want your server to appear in the server list)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The ASE port is also simple to get:&lt;br /&gt;
&lt;br /&gt;
ASE port = Main server port + 123&lt;br /&gt;
&lt;br /&gt;
So, if you have the main server port set to 22003, then the ASE port will be 22126.&lt;br /&gt;
&lt;br /&gt;
Good luck!&lt;br /&gt;
&lt;br /&gt;
''In the latest version of the server, you can check the port status by using the server command [[Server_Commands#openports|openports]].''&lt;br /&gt;
&lt;br /&gt;
===Client Checks===&lt;br /&gt;
&lt;br /&gt;
The MTA server can be configured to disable the anti-cheat. It can also allow specific or all files to be modified (e.g. carmods.dat), and make sure clients are of a minimum version.&lt;br /&gt;
&lt;br /&gt;
All of these settings are within the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]'. See the [[Anti-cheat_guide|Anti-cheat guide]] for more details.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to force a minimum client version, search for the following line:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;minclientversion&amp;gt;&amp;lt;/minclientversion&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Accepted values look like: 1.1.1-9.02320&lt;br /&gt;
&lt;br /&gt;
===Adding administrators===&lt;br /&gt;
It is strongly recommended to add at least one administrator to your server in order to make use of the built-in webserver to easily maintain and configure your server. This administrator will then also be able to log-in from within the game and control the server.&lt;br /&gt;
&lt;br /&gt;
To add an administrator to your server, follow these steps:&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;While the server is running, add a new account by typing '''[[Server_Commands#addaccount|addaccount name password]]''' into the server window. For example, to add user BennyLava you could type:&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 10px 10px 10px 10px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
addaccount BennyLava 123password&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 10px 10px 10px 20px;&amp;quot;&amp;gt;&lt;br /&gt;
''Note: If you do not have access to the server window, and the 'admin' resource is running, you can add  the example account by issuing the chatbox command '''/register BennyLava 123password'''''&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;The server should display a message confirming the account has been added.&lt;br /&gt;
&amp;lt;li&amp;gt;Next, shutdown the server by typing '''shutdown''' into the server window.&lt;br /&gt;
&amp;lt;li&amp;gt;Make sure your server is stopped; if your server is still running, the following changes you make will be overwritten&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open the file 'mods/deathmatch/'acl.xml'''' with any text editor&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Add the account to the ''Admin'' group by using the XML-syntax below&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;acl&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
  &amp;lt;group name=&amp;quot;Admin&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;acl name=&amp;quot;Admin&amp;quot;/&amp;gt;&lt;br /&gt;
    ...&lt;br /&gt;
    &amp;lt;object name=&amp;quot;user.BennyLava&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/group&amp;gt;&lt;br /&gt;
  ...&lt;br /&gt;
&amp;lt;/acl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can actually add your user to any group you want. Each group is linked to an ACL ([[Access Control List]]). Each ACL contains a series of specific allowed or denied rights. These groups exist so different users can be assigned different rights. The ''Admin'' group points to the ''Admin'' ACL, which is empty (thus allowing all possible commands). The ''Everyone'' group points to the ''Default'' ACL that puts a series of restrictions on the available commands (to disallow regular players from using admin commands).&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;&lt;br /&gt;
You're done! You can add as many administrators or users as you want this way, take a look at some of the other groups and ACLs for example. The ACL is also accessible through the [[Access_Control_List|Lua scripting engine]].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is recommended to take a look at the web interface, we will explain how to do this below.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
'''Note''': There are also ways to add accounts and edit rights for the server while it's running. &amp;quot;[[Server_Commands#addaccount|addaccount &amp;lt;user&amp;gt; &amp;lt;password&amp;gt;]]&amp;quot; is an internal command to add accounts, but you will have to use the web interface to add these accounts to specific groups/ACLs!&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Using the web interface===&lt;br /&gt;
The dedicated server comes with a few Lua [[resources]] that provide a nice little web interface to your server. This can be used to easily maintain your server, as it allows you to add users, start/stop resources, and more.&lt;br /&gt;
&lt;br /&gt;
The web interface resources are enabled by default and are served through the built-in HTTP web server. To make sure the built-in HTTP web server runs on a port you like (22005 by default), follow these steps:&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Make sure your server is stopped&lt;br /&gt;
&amp;lt;li&amp;gt;Open the file 'mods/deathmatch/[[Server_mtaserver.conf|'''mtaserver.conf''']]' with any text editor&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Verify that the HTTP server is enabled:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Change the HTTP server port to your liking:&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
	&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Save and close the configuration file&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Start your server&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;If you happened to have changed the start-up resources in your configuration file, make sure the following resources are started:&lt;br /&gt;
&lt;br /&gt;
# resourcebrowser&lt;br /&gt;
# resourcemanager&lt;br /&gt;
# webadmin&lt;br /&gt;
# webmap&lt;br /&gt;
&lt;br /&gt;
These are automatically started in the default configuration file, in case you just installed your server.&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Open a web browser (Internet Explorer 6 or 7 are NOT supported; use [http://www.mozilla.com/firefox Mozilla Firefox], [http://www.google.com/chrome Google Chrome], [http://www.apple.com/safari/download Apple Safari], [http://www.opera.com Opera] or others) and navigate to the HTTP server URL: '''http://server:port/'''. For example, If you are running a local server on HTTP port 22005, use '''http://127.0.0.1:22005/'''.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Enter the username and password of the administrator you added in the previous section.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
You should now be able to maintain your server from the web interface.&lt;br /&gt;
&lt;br /&gt;
=== Configuring an external web server ===&lt;br /&gt;
The built-in web server is also used to serve files that are required by resources running on your server to any player that is connected to your server. For example, if you are running a game script with a scripted graphical user interface, or custom models, these need to be transferred to every connected player in order to function properly. This is done by either the built-in web server, or an external web server (that is usually a bit faster) but needs to be set up separately.&lt;br /&gt;
&lt;br /&gt;
For performance or consistency reasons during the game, you could choose to make use of such an external web server if you have one set up. The external web server needs to be accessible for the public, so any client will be able to download the necessary client-side files in order to join and play on your server.&lt;br /&gt;
&lt;br /&gt;
To enable downloading off an external web server, you should configure the [[Server_mtaserver.conf#httpdownloadurl|httpdownloadurl]] tag in your server configuration:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;	&lt;br /&gt;
&amp;lt;httpdownloadurl&amp;gt;http://www.myserver.tld/directory/here&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since all the default resources provided with the dedicated server are zipped, and are normally automatically extracted by the built-in web server, you now have to provide a way for the clients to download the compressed files to their computers. To configure MTA to maintain a copy of only your unzipped client resources, set [[Server_mtaserver.conf#httpautoclientfiles|httpautoclientfiles]] in your server configuration: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;padding: 10px&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&amp;lt;httpautoclientfiles&amp;gt;1&amp;lt;/httpautoclientfiles&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now when you launch the server, the directory '''&amp;lt;SERVER&amp;gt;/mods/deathmatch/resource-cache/http-client-files''' will contain the correct client files for hosting on an external web server. If the web server is on the same machine, you can simply link the appropriate web server directory to '''http-client-files'''. If the web server is on a separate machine, ensure it has access to '''http-client-files''' via a network path, or maintain a remote copy using synchronization software.&lt;br /&gt;
&lt;br /&gt;
'''Note 1''': Please try to avoid any special characters (e.g. ~, !) in your download URLs.&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note 2''': Please do not use a trailing slash in your download URL (e.g. ''hxxp://www.myserver.tld/directory'' rather than ''hxxp://www.myserver.tld/directory/'')&lt;br /&gt;
&lt;br /&gt;
==Starting your server==&lt;br /&gt;
Begin by making sure that you have finished all configuration of your server, starting your server is the last stage so everything must be ready!&lt;br /&gt;
&lt;br /&gt;
To start your server double click on MTA Server.exe, make sure you allow it through any firewalls and forward ports where necessary.&lt;br /&gt;
&lt;br /&gt;
==Installing/Updating resources on your server==&lt;br /&gt;
Resources can come in two formats, either a ZIP format or just a normal folder with the script files inside it. The MTA:SA server supports both these methods.&lt;br /&gt;
&lt;br /&gt;
# Move or copy the new resource to your &amp;lt;SERVER&amp;gt;\mods\deathmatch\resources folder.&lt;br /&gt;
# In the server window type in the command [[Server_Commands#refresh|refresh]], this will re-scan the resources folder and update the live resources where necessary.&lt;br /&gt;
&lt;br /&gt;
==Uninstalling resources==&lt;br /&gt;
Resources can easily be removed from your server if you no longer want them.&lt;br /&gt;
&lt;br /&gt;
# Delete the ZIP file or the folder of the resource you wish to uninstall&lt;br /&gt;
# In the server window type in the command &amp;quot;refresh&amp;quot; (without the quotes), this will re-scan the resources folder and update the live resources where necessary.&lt;br /&gt;
&lt;br /&gt;
==Administrating your server==&lt;br /&gt;
You can start resources by typing the command &amp;quot;start resourcename&amp;quot; in the server console, or stop ones with &amp;quot;stop resourcename&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
It's also possible to execute these and other admin commands from the in-game console (which you can bring up with the ` key or F8); for this to work, you first need to log in with the command &amp;quot;[[Server_Commands#login|login username password]]&amp;quot;. Additionally, you can press the p key to bring up the admin panel: this is a graphical interface which allows you to easily kick or ban misbehaving players, among others.&lt;br /&gt;
&lt;br /&gt;
For further commands, type [[Server_Commands#help|help]] in a console.&lt;br /&gt;
&lt;br /&gt;
==Starting a map/gamemode==&lt;br /&gt;
See the commands section of the documentation for [[Resource:Map manager|mapmanager]] for more information.&lt;br /&gt;
&lt;br /&gt;
==Useful Notes==&lt;br /&gt;
&lt;br /&gt;
# You may also update the resources while in-game as long as you have the correct access levels by typing &amp;quot;refresh&amp;quot; in the clients console or &amp;quot;/refresh&amp;quot; in the chat window. This may cause a second of lag if you have many resources.&lt;br /&gt;
# In the above instructions, &amp;lt;SERVER&amp;gt; is the path to your server's main directory. In most cases this is C:\Program Files\MTA San Andreas\server&lt;br /&gt;
# You can choose a different config file for the server to use by passing it in the command line after a --config argument, e.g. mtaserver.exe --config anotherconfig.cfg.&lt;br /&gt;
# Do not be alarmed by the warning regarding the parsing of the settings.xml file. This happens because your server installation is still clean and unused.&lt;br /&gt;
&lt;br /&gt;
====Need further help?====&lt;br /&gt;
Why not pop over to our [http://forum.mtasa.com/ Forums] or join us on [irc://irc.multitheftauto.com/mta IRC] (irc.multitheftauto.com #mta - [http://www.mirc.com mIRC])&lt;br /&gt;
&lt;br /&gt;
[[es:Manual Servidor]]&lt;br /&gt;
[[de:Server Anleitung]]&lt;br /&gt;
[[it:Manuale del Server]]&lt;br /&gt;
[[nl:Server Manual]]&lt;br /&gt;
[[ru:Server Manual]]&lt;br /&gt;
[[pl:Server Manual]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Support]]&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=29769</id>
		<title>ToJSON</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ToJSON&amp;diff=29769"/>
		<updated>2012-03-29T19:00:56Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: ToJSON was described wrong, it only grabs one argument, updated syntax, description and example&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;
This function converts '''one''' variable (preferably a 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 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''var:''' An arguments 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;
===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>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=29768</id>
		<title>SetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=29768"/>
		<updated>2012-03-29T18:49:06Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function stores [[element data]] under a certain key, attached to an element. Element data set using this is then synced with all clients or the server. As such you should avoid passing data that is not able to be synced into this function (i.e. xmlnodes, acls, aclgroups etc.) Server-created elements are able to be synced.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under. (Maximum 31 characters.) &lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''synchronize:''' Determines whether or not the data will be synchronized with the server (client-side variation) and remote clients (both variations).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set succesfully, ''false'' otherwise.&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 allows for a player to add a custom tag onto their nickname, and also revert it back to normal if they wish&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function addPlayerCustomTag ( thePlayer, command, newTag )&lt;br /&gt;
	--Let's make sure the newTag param has been entered...&lt;br /&gt;
	if ( newTag ) then&lt;br /&gt;
		--Grab their current playername for saving.&lt;br /&gt;
		local sPlayerNickname = getPlayerName ( thePlayer )&lt;br /&gt;
		--Create their new nickname with their tag&lt;br /&gt;
		local sNewPlayerNickname = newTag .. &amp;quot; &amp;quot; .. sPlayerNickname&lt;br /&gt;
		&lt;br /&gt;
		--Let's first load the element data, see if it's there already&lt;br /&gt;
		--The reason for this is that if a player were to do /addtag twice,&lt;br /&gt;
		--the tag would be prepended a second time&lt;br /&gt;
		local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
		if ( sOldNick == false ) then&lt;br /&gt;
			--Save their orignal nickname in their element data&lt;br /&gt;
			setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, sPlayerNickname )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--Set their new nickname globally&lt;br /&gt;
		setPlayerName ( thePlayer, sNewPlayerNickname )&lt;br /&gt;
		&lt;br /&gt;
		--Tell them it's done&lt;br /&gt;
		outputChatBox ( &amp;quot;Your new nickname has been set, to put it back to its original state you can use /deltag&amp;quot;, thePlayer )&lt;br /&gt;
	else&lt;br /&gt;
		--The newTag param was not entered, give an error message&lt;br /&gt;
		outputChatBox ( &amp;quot;/addtag - Incorrect syntax, Correct: /addtag &amp;lt;newtag&amp;gt;&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;addtag&amp;quot;, addPlayerCustomTag )&lt;br /&gt;
&lt;br /&gt;
function removePlayerCustomTag ( thePlayer, command )&lt;br /&gt;
	--We first need to check that they have already used /addtag, let's do that now&lt;br /&gt;
	local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
	if ( sOldNick ) then&lt;br /&gt;
		--Great, they have a tag added, let's reset them&lt;br /&gt;
		&lt;br /&gt;
		--First we will want to reset the element data back to its default (that being false)&lt;br /&gt;
		setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, false )&lt;br /&gt;
		&lt;br /&gt;
		--Now set the client name back&lt;br /&gt;
		setClientName ( thePlayer, sOldNick )&lt;br /&gt;
		&lt;br /&gt;
		--Notify them&lt;br /&gt;
		outputChatBox ( &amp;quot;Your old nickname has been set&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;deltag&amp;quot;, removePlayerCustomTag )&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>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CopyResource&amp;diff=29759</id>
		<title>CopyResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CopyResource&amp;diff=29759"/>
		<updated>2012-03-29T02:50:02Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: /* Returns */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function copies a specified [[resource]] with a new name.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function only works properly from 1.3.0-3912 (r3912). In case you are below r3912 you need to create a directory called &amp;quot;trash&amp;quot; inside of the &amp;quot;resources-cache&amp;quot; folder .&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource copyResource ( resource theResource, string newResourceName [, string organizationalDir ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the resource which is going to be copied&lt;br /&gt;
*'''newResourceName:''' the name that the copied resource will receive&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''organizationalDir''': A string containing the path where the resource should be copied to (e.g. &amp;quot;[gamemodes]/[amx]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [[resource]] element of the copy. Returns ''false'' if the arguments are incorrect.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- This script can backup your resource with a easy command! /backupresource [resourcename]&lt;br /&gt;
function backupResource (player,command,resourcetobackup) -- start the function&lt;br /&gt;
  if (resourcetobackup) and (getResourceFromName(resourcetobackup)) then -- check if the resource is exist&lt;br /&gt;
    copyResource (getResourceFromName(resourcetobackup),resourcetobackup .. &amp;quot;_backup&amp;quot;) -- copy the resource and give it the name [resource]_backup&lt;br /&gt;
    outputChatBox (&amp;quot;Resource &amp;quot; .. resourcetobackup .. &amp;quot; succesfully backed up!&amp;quot;,player,255,0,0,false) -- say it's OK!&lt;br /&gt;
  else -- if it isn't exist&lt;br /&gt;
    outputChatBox (&amp;quot;Resource can't be backed up! (don't forget the parameters!)&amp;quot;,player,255,0,0,false) -- say it isn't exist!&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler (&amp;quot;backupresource&amp;quot;,backupResouce) -- add command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Help:Editing_Guidelines&amp;diff=29758</id>
		<title>Help:Editing Guidelines</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Help:Editing_Guidelines&amp;diff=29758"/>
		<updated>2012-03-28T23:53:08Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: /* Script Examples */  Added: Preferably use four spaces instead of one tabulator.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;gt; '''This page is work in progress (WIP)''' &amp;lt;&lt;br /&gt;
&lt;br /&gt;
Before you contribute to the Multi Theft Auto Wiki make sure you know/understand the basics of [http://www.mediawiki.org/wiki/Help:Contents MediaWiki].&lt;br /&gt;
&lt;br /&gt;
== Editing Pages ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 85%;&amp;quot;&amp;gt;''MediaWiki general help page: [http://www.mediawiki.org/wiki/Help:Editing_pages Editing Pages]''&amp;lt;/div&amp;gt;&lt;br /&gt;
=== Minor Edits ===&lt;br /&gt;
From Wikipedia: &amp;quot;A check to the &amp;quot;minor edit&amp;quot; box signifies that only superficial differences exist between the version with your edit and the previous version: typo corrections, formatting and presentational changes, rearranging of text without modifying content, etc. A minor edit is a version that the editor believes requires no review and could never be the subject of a dispute. The &amp;quot;minor edit&amp;quot; option is one of several options available only to registered users.&amp;quot;&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Help:Minor_edit&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Editing Function/Event Pages ===&lt;br /&gt;
[[File:Layout function page.png|thumb|Layout Function Pages]]&lt;br /&gt;
&lt;br /&gt;
Specific information for editing the MTA Wiki.&lt;br /&gt;
&lt;br /&gt;
===== Contents of Function/Event Pages =====&lt;br /&gt;
Function and event pages have a layout that is easy to identify and consistent. Before adding function and/or event pages make sure they do exist in the MTA Core!&lt;br /&gt;
&lt;br /&gt;
====== Layout Function Pages ======&lt;br /&gt;
* No Table of Contents: &amp;lt;nowiki&amp;gt;__NOTOC__&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Define if function is server and/or client: &amp;lt;nowiki&amp;gt;{{Server client function}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** Server only function:  &amp;lt;nowiki&amp;gt;{{Server function}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** Client only function:  &amp;lt;nowiki&amp;gt;{{Client function}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** Both client and server: &amp;lt;nowiki&amp;gt;{{Server client function}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Explain the function&lt;br /&gt;
* Syntax: Use &amp;lt;nowiki&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** Required Arguments&lt;br /&gt;
** Optional Arguments (not always necessary)&lt;br /&gt;
* Returns&lt;br /&gt;
* Example&lt;br /&gt;
* See Also: Add the template to which function group this function belongs&lt;br /&gt;
&lt;br /&gt;
====== Layout Event Pages ======&lt;br /&gt;
* No Table of Contents: &amp;lt;nowiki&amp;gt;__NOTOC__&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Define if event is server or client: &amp;lt;nowiki&amp;gt;{{server event}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** Server event:  &amp;lt;nowiki&amp;gt;{{Server event}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** Client event:  &amp;lt;nowiki&amp;gt;{{Client event}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
* Parameters&lt;br /&gt;
* Source: The source of the event.&lt;br /&gt;
* Example&lt;br /&gt;
* See Also&lt;br /&gt;
&lt;br /&gt;
Events can only be server or client side not both.&lt;br /&gt;
&lt;br /&gt;
===== Tips =====&lt;br /&gt;
* When creating a new page for a function or event, you need to edit the template for 'See Also' too. If you don't add it to a function/event group template this page is considered orphaned and no one will find it unless they use the search function.&lt;br /&gt;
* When you don't want to add examples, add the &amp;lt;nowiki&amp;gt;{{Needs Example}}&amp;lt;/nowiki&amp;gt; template at the top of the page.&lt;br /&gt;
* If you added examples to a page make sure to remove template &amp;lt;nowiki&amp;gt;{{Needs Example}}&amp;lt;/nowiki&amp;gt; when necessary. &lt;br /&gt;
&lt;br /&gt;
== Script Examples ==&lt;br /&gt;
When writing a script example always test and verify that your example is working, submitting not working examples is a waste of time for everyone.&lt;br /&gt;
&lt;br /&gt;
* Preferably use four spaces instead of one tabulator.&lt;br /&gt;
* Use the syntaxhighlighting codebox provided on this wiki. (&amp;lt;nowiki&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;(CODE HERE)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;/nowiki&amp;gt;)&lt;br /&gt;
* If the event/function is both client and server you should use the section template with server and/or client classes.&lt;br /&gt;
** For server side examples: &amp;lt;nowiki&amp;gt;&amp;lt;section name=&amp;quot;Example 1&amp;quot; &amp;lt;/nowiki&amp;gt;'''class=&amp;quot;server&amp;quot;'''&amp;lt;nowiki&amp;gt; show=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
** For client side examples: &amp;lt;nowiki&amp;gt;&amp;lt;section name=&amp;quot;Example 2&amp;quot; &amp;lt;/nowiki&amp;gt;'''class=&amp;quot;client&amp;quot;'''&amp;lt;nowiki&amp;gt; show=&amp;quot;false&amp;quot;&amp;gt;&amp;lt;/section&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When an event/function is only client or server side you should only use the code box not the section tags. &lt;br /&gt;
&lt;br /&gt;
If there are enough scripting examples, remove the template &amp;lt;nowiki&amp;gt;{{Needs Example}}&amp;lt;/nowiki&amp;gt; or the &amp;lt;nowiki&amp;gt;[[Category:Needs Example]]&amp;lt;/nowiki&amp;gt; when necessary.&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&amp;lt;div style=&amp;quot;font-size: 85%;&amp;quot;&amp;gt;''MediaWiki general help page: [http://www.mediawiki.org/wiki/Help:Templates Templates]''&amp;lt;/div&amp;gt;&lt;br /&gt;
Templates are a consistent set of visual styling and can be used in articles to get the reader's attention or mark a page for example as outdated. Some templates also require arguments, for more information on how to use MTA's specific wiki templates go [[MTA Wiki:Specific Templates |here]].&lt;br /&gt;
{{Tip|If you want to avoid spacing between the page title and the template itself, you should include the template before __NOTOC__ other templates and/or [http://www.mediawiki.org/wiki/Help:Magic_words magic words].}}&lt;br /&gt;
Using templates is recommended when using the same content over a large number of pages. This will save you time when you want to change something in that content and doesn't require you to edit all the pages but just the template.&lt;br /&gt;
&lt;br /&gt;
* [[MTA Wiki:Specific Templates |How to use MTA Wiki's Specific templates]]&lt;br /&gt;
&lt;br /&gt;
== Protected Pages ==&lt;br /&gt;
Protected pages cannot be modified by normal users, if you want to change something on a protected page you will have to ask someone who as the right permissions to modify them.&amp;lt;ref&amp;gt;http://www.mediawiki.org/wiki/Help:Protected_pages&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
== Icons ==&lt;br /&gt;
When you want to use icons, it is recommended to use general icons this improves the consistency of the wiki. &lt;br /&gt;
&lt;br /&gt;
* [[MTA Wiki:Tango Icon List |Tango Icon List]]&lt;br /&gt;
&lt;br /&gt;
== Helpful links ==&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Wikipedia:Cheatsheet Wikipedia Cheatsheet] - Quick overview of general editing tags and functions.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references&amp;gt;&amp;lt;/references&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:MTA Wiki:Editing]]&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Modules/MTA-MySQL&amp;diff=29757</id>
		<title>Modules/MTA-MySQL</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Modules/MTA-MySQL&amp;diff=29757"/>
		<updated>2012-03-28T23:45:49Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;pageclass class=&amp;quot;#AA7592&amp;quot; subcaption=&amp;quot;MTA-MySQL Module&amp;quot;&amp;gt;&amp;lt;/pageclass&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Module_Info|&lt;br /&gt;
  name           = MTA MySQL |&lt;br /&gt;
  version        = 0.5 |&lt;br /&gt;
  author         = [[User:ryden|Alberto Alonso (ryden)]] |&lt;br /&gt;
  module_website = [http://code.google.com/p/multitheftauto-modules Here] |&lt;br /&gt;
  download_link  = [http://code.google.com/p/multitheftauto-modules/downloads/list Here] |&lt;br /&gt;
  license        = [http://www.opensource.org/licenses/bsd-license.php BSD] |&lt;br /&gt;
  written_in     = C++ |&lt;br /&gt;
  operating_system = Cross-platform |&lt;br /&gt;
  compatible_with = DP2.x &amp;amp; 1.X |&lt;br /&gt;
}}&lt;br /&gt;
MTA MySQL is an alternative to the default [[Modules/MySQL|ml_mysql]] module provided by the MTA team.&lt;br /&gt;
It is available for Windows and GNU/Linux and provides the source code.&lt;br /&gt;
&lt;br /&gt;
''Note: From version 0.4 it supports both DP2.3 and 1.0 servers.''&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
===Windows===&lt;br /&gt;
Uncompress the file mta_mysql.dll into your ''C:\Program files\MTA San Andreas\server\mods\deathmatch\modules\'' directory and the file libmysql.dll into your ''C:\Program files\MTA San Andreas\server\'' directory.&lt;br /&gt;
&lt;br /&gt;
Then, add the following line in mtaserver.conf:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;module src=&amp;quot;mta_mysql.dll&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===GNU/Linux===&lt;br /&gt;
Uncompress the file mta_mysql.so in the ''mods/deathmatch/modules/'' directory.&lt;br /&gt;
&lt;br /&gt;
Then, add the following line in mtaserver.conf:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;module src=&amp;quot;mta_mysql.so&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To fix '''MODULE: Unable to find modules/mta_mysql.so (libmysqlclient.so.15: cannot open shared object file: No such file or directory)!''' you have to install libmysqlclient15.&lt;br /&gt;
You can get it here: http://automation.binarysage.net/?p=1311&lt;br /&gt;
&lt;br /&gt;
'''If you experience an error on Unix systems:'''&lt;br /&gt;
Try to add port and socket parameters to your mysql_connect.&lt;br /&gt;
&lt;br /&gt;
==Handler functions==&lt;br /&gt;
{{Modules/MTA-MySQL/Handler_functions}}&lt;br /&gt;
&lt;br /&gt;
==Result managing functions==&lt;br /&gt;
{{Modules/MTA-MySQL/Result_functions}}&lt;br /&gt;
&lt;br /&gt;
==Version 0.5 calling method==&lt;br /&gt;
From version 0.5 onwards you can call all this module functions, except mysql_connect and mysql_null, as if they are methods of an object.&lt;br /&gt;
&lt;br /&gt;
For example, having a valid MySQL handler, you can do handler:query ( &amp;quot;SELECT * FROM table&amp;quot; ) instead of mysql_query ( handler, &amp;quot;SELECT * FROM table&amp;quot; ).&lt;br /&gt;
&lt;br /&gt;
===Function aliases===&lt;br /&gt;
A function alias is a second name for a function, which makes calling any of the original name or the alias have the same result. The new aliases introduced in version 0.5 are:&lt;br /&gt;
* result:num_rows() is the same as result:numrows()&lt;br /&gt;
* result:num_fields() is the same as result:numfields()&lt;br /&gt;
* result:free_result() is the same as result:free()&lt;br /&gt;
&lt;br /&gt;
[[Category:Modules]]&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPedWasted&amp;diff=29756</id>
		<title>OnPedWasted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPedWasted&amp;diff=29756"/>
		<updated>2012-03-28T23:39:08Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
This event is triggered when a ped is killed or dies. It is not triggered for players.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int totalAmmo, element killer, int killerWeapon, int bodypart [, bool stealth ]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''totalAmmo''': an integer representing the total ammo the victim had when he died.&lt;br /&gt;
*'''killer''': an [[element]] representing the player or vehicle who was the killer.  If there was no killer this is ''false''.&lt;br /&gt;
*'''killerWeapon''': an integer representing the [[Weapons|killer weapon]] or the [[Death Reasons|death reason]].&lt;br /&gt;
*'''bodypart''': an integer representing the bodypart ID the victim was hit on when he died.&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
*'''stealth''': boolean value representing whether or not this was a stealth kill&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[ped]] that died or got killed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--TODO&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped_events}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateVehicle&amp;diff=29755</id>
		<title>CreateVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateVehicle&amp;diff=29755"/>
		<updated>2012-03-28T23:34:50Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: /* Syntax */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Needs_Checking|Numberplates only seem to work for some vehicles, and then only for the front or rear plate only}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{note_box|Vehicles (and other elements) created client-side are only seen by the client that created them, aren't synced and players cannot enter them. They are essentially for display only.}}&lt;br /&gt;
This function creates a vehicle at the specified location.&lt;br /&gt;
&lt;br /&gt;
Its worth noting that the position of the vehicle is the center point of the vehicle, not its base. As such, you need to ensure that the z value (vertical axis) is some height above the ground. You can find the exact height using the client side function [[getElementDistanceFromCentreOfMassToBaseOfModel]], or you can estimate it yourself and just spawn the vehicle so it drops to the ground.&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;
vehicle createVehicle ( int model, float x, float y, float z [, float rx, float ry, float rz, string numberplate, bool bDirection, int variant1, int variant2 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''model''': The [[Vehicle IDs|vehicle ID]] of the vehicle being created.&lt;br /&gt;
* '''x''': A floating point number representing the X coordinate on the map.&lt;br /&gt;
* '''y''': A floating point number representing the Y coordinate on the map.&lt;br /&gt;
* '''z''': A floating point number representing the Z coordinate on the map.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''rx''': A floating point number representing the rotation about the X axis in degrees.&lt;br /&gt;
* '''ry''': A floating point number representing the rotation about the Y axis in degrees.&lt;br /&gt;
* '''rz''': A floating point number representing the rotation about the Z axis in degrees.&lt;br /&gt;
* '''numberplate''': A string that will go on the number plate of the car (max 8 characters). This is only applicable to cars.&lt;br /&gt;
* '''direction''': A boolean which should be set to false. *SERVER ONLY*&lt;br /&gt;
{{New feature/item|3.0120|1.2|| &lt;br /&gt;
* '''variant1''': An integer for the first vehicle variant see [[Vehicle variants]]&lt;br /&gt;
* '''variant2''': An integer for the second vehicle variant see [[Vehicle variants]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [[vehicle]] element that was created. Returns ''false'' if the arguments are incorrect, or if the vehicle limit of 65535 is exceeded.&lt;br /&gt;
&lt;br /&gt;
==Using trains==&lt;br /&gt;
Trains are created using the createVehicle function. They are placed at the nearest point of the GTASA train pathing (railroad tracks) from their spawning point. &lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1: Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script spawns a Rhino on top of one lucky individual.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptCreateTank ( player, command )&lt;br /&gt;
      local luckyBugger = getRandomPlayer() -- get a random player&lt;br /&gt;
      local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position&lt;br /&gt;
      createVehicle ( 432, x, y, z + 10 ) -- create the tank 10 units above them&lt;br /&gt;
      outputChatBox ( &amp;quot;You got Tank'd!&amp;quot;, luckyBugger )&lt;br /&gt;
end&lt;br /&gt;
--Attach the 'scriptCreateTank' function to the &amp;quot;tank&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;tank&amp;quot;, scriptCreateTank )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2: Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This script spawns a Rhino on top of the local player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function scriptCreateTank ( commandName )&lt;br /&gt;
      local luckyBugger = getLocalPlayer() -- get the local player&lt;br /&gt;
      local x, y, z = getElementPosition ( luckyBugger ) -- retrive the player's position&lt;br /&gt;
      createVehicle ( 432, x, y, z + 10 ) -- create the tank 10 units above them&lt;br /&gt;
      outputChatBox ( &amp;quot;You got Tank'd!&amp;quot;, 255, 0, 0)&lt;br /&gt;
end&lt;br /&gt;
--Attach the 'scriptCreateTank' function to the &amp;quot;tank&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;tank&amp;quot;, scriptCreateTank )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 3: Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a vehicle five units to the right of a player when they type ''createvehicle'' and its name in the console:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local distance = 5 --units&lt;br /&gt;
&lt;br /&gt;
-- define our handler (we'll take a variable number of parameters where the name goes, because there are vehicle names with more than one word)&lt;br /&gt;
function consoleCreateVehicle ( sourcePlayer, commandName, ... )&lt;br /&gt;
   -- if a player triggered it, not the admin,&lt;br /&gt;
   if ( sourcePlayer ) then&lt;br /&gt;
      -- calculate the position of the vehicle based on the player's position and rotation:&lt;br /&gt;
      local x, y, z = getElementPosition ( sourcePlayer ) -- get the player's position&lt;br /&gt;
      local rotZ = getPedRotation ( sourcePlayer ) -- get the player's rotation around the Z axis in degrees&lt;br /&gt;
      x = x + ( ( math.cos ( math.rad ( rotZ ) ) ) * distance ) -- calculate the X position of the vehicle&lt;br /&gt;
      y = y + ( ( math.sin ( math.rad ( rotZ ) ) ) * distance ) -- calculate the Y position of the vehicle&lt;br /&gt;
&lt;br /&gt;
      -- get the complete vehicle name by joining all passed parameters using Lua function table.concat&lt;br /&gt;
      local vehicleName = table.concat({...}, &amp;quot; &amp;quot;)&lt;br /&gt;
      -- get the vehicle's model ID from the name&lt;br /&gt;
      local vehicleID = getVehicleModelFromName ( vehicleName )&lt;br /&gt;
      -- if vehicle ID is valid,&lt;br /&gt;
      if vehicleID then&lt;br /&gt;
            -- create the vehicle using the information gathered above:&lt;br /&gt;
            local newVehicle = createVehicle ( vehicleID, x, y, z, 0, 0, rotZ )&lt;br /&gt;
            -- if vehicle creation failed, give the player a message&lt;br /&gt;
            if not newVehicle then&lt;br /&gt;
               outputConsole ( &amp;quot;Failed to create vehicle.&amp;quot;, sourcePlayer )&lt;br /&gt;
            end&lt;br /&gt;
      end&lt;br /&gt;
   end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Attach the 'consoleCreateVehicle' function to the &amp;quot;createvehicle&amp;quot; command&lt;br /&gt;
addCommandHandler ( &amp;quot;createvehicle&amp;quot;, consoleCreateVehicle )&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;
&lt;br /&gt;
&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPedWasted&amp;diff=29754</id>
		<title>OnPedWasted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPedWasted&amp;diff=29754"/>
		<updated>2012-03-28T23:33:57Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Removed bullshit example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a ped is killed or dies. It is not triggered for players.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int totalAmmo, element killer, int killerWeapon, int bodypart [, bool stealth ]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''totalAmmo''': an integer representing the total ammo the victim had when he died.&lt;br /&gt;
*'''killer''': an [[element]] representing the player or vehicle who was the killer.  If there was no killer this is ''false''.&lt;br /&gt;
*'''killerWeapon''': an integer representing the [[Weapons|killer weapon]] or the [[Death Reasons|death reason]].&lt;br /&gt;
*'''bodypart''': an integer representing the bodypart ID the victim was hit on when he died.&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
*'''stealth''': boolean value representing whether or not this was a stealth kill&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[ped]] that died or got killed.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped_events}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnElementStopSync&amp;diff=29753</id>
		<title>OnElementStopSync</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnElementStopSync&amp;diff=29753"/>
		<updated>2012-03-28T23:31:48Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Warning|In 1.1.x, Destroying the source of this event could crash the server!|true}}&lt;br /&gt;
&lt;br /&gt;
This event is triggered when an element is no longer synced by a player.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player oldSyncer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''oldSyncer''': [[player]] element representing the last player who was syncing the element&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[element]] which is no longer synced by a player.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This script creates a vehicle in the center of the map and outputs a message to its old syncer if he is not syncing the vehicle anymore.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
--create our testing vehicle onResourceStart&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement( ),&lt;br /&gt;
function ( )&lt;br /&gt;
    vehicle = createVehicle ( 520, 0, 0, 0 )&lt;br /&gt;
end )&lt;br /&gt;
&lt;br /&gt;
function syncStop ( oldSyncer )&lt;br /&gt;
    -- check if the element that stopped being synced was our vehicle&lt;br /&gt;
    if source == vehicle then&lt;br /&gt;
        --tell the player (oldSyncer) he stopped syncing the vehicle&lt;br /&gt;
        outputChatBox ( &amp;quot;The vehicle is not being synced by you anymore&amp;quot;, oldSyncer )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
--add the event handler&lt;br /&gt;
addEventHandler( &amp;quot;onElementStopSync&amp;quot;, getRootElement(), syncStop ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Element events}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CopyResource&amp;diff=29752</id>
		<title>CopyResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CopyResource&amp;diff=29752"/>
		<updated>2012-03-28T23:25:06Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Syntax update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function copies a specified [[resource]] with a new name.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function only works properly from 1.3.0-3912 (r3912). In case you are below r3912 you need to create a directory called &amp;quot;trash&amp;quot; inside of the &amp;quot;resources-cache&amp;quot; folder .&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
resource copyResource ( resource theResource, string newResourceName [, string organizationalDir ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the resource which is going to be copied&lt;br /&gt;
*'''newResourceName:''' the name that the copied resource will receive&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''organizationalDir''': A string containing the path where the resource should be copied to (e.g. &amp;quot;[gamemodes]/[amx]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [[resource]] element that was copied. Returns ''false'' if the arguments are incorrect&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- This script can backup your resource with a easy command! /backupresource [resourcename]&lt;br /&gt;
function backupResource (player,command,resourcetobackup) -- start the function&lt;br /&gt;
  if (resourcetobackup) and (getResourceFromName(resourcetobackup)) then -- check if the resource is exist&lt;br /&gt;
    copyResource (getResourceFromName(resourcetobackup),resourcetobackup .. &amp;quot;_backup&amp;quot;) -- copy the resource and give it the name [resource]_backup&lt;br /&gt;
    outputChatBox (&amp;quot;Resource &amp;quot; .. resourcetobackup .. &amp;quot; succesfully backed up!&amp;quot;,player,255,0,0,false) -- say it's OK!&lt;br /&gt;
  else -- if it isn't exist&lt;br /&gt;
    outputChatBox (&amp;quot;Resource can't be backed up! (don't forget the parameters!)&amp;quot;,player,255,0,0,false) -- say it isn't exist!&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler (&amp;quot;backupresource&amp;quot;,backupResouce) -- add command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnElementStopSync&amp;diff=29751</id>
		<title>OnElementStopSync</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnElementStopSync&amp;diff=29751"/>
		<updated>2012-03-28T23:21:32Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: /* Example */  Spaces ftw&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Warning|In 1.1.x, Destroying the source of this event could crash the server!|true}}&lt;br /&gt;
&lt;br /&gt;
This event is triggered when an element is no longer synced by a player.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player oldSyncer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''oldSyncer''': [[player]] element representing the last player who was syncing the element&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[element]] which is no longer synced by a player.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This script creates a vehicle in the center of the map and outputs a message to its old syncer if he is not syncing the vehicle anymore.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;server&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;
--create our testing vehicle onResourceStart&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement( ),&lt;br /&gt;
function ( )&lt;br /&gt;
    vehicle = createVehicle ( 520, 0, 0, 0 )&lt;br /&gt;
end )&lt;br /&gt;
&lt;br /&gt;
function syncStop ( oldSyncer )&lt;br /&gt;
    -- check if the element that stopped being synced was our vehicle&lt;br /&gt;
    if source == vehicle then&lt;br /&gt;
        --tell the player (oldSyncer) he stopped syncing the vehicle&lt;br /&gt;
        outputChatBox ( &amp;quot;The vehicle is not being synced by you anymore&amp;quot;, oldSyncer )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
--add the event handler&lt;br /&gt;
addEventHandler( &amp;quot;onElementStopSync&amp;quot;, getRootElement(), syncStop ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Element events}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnElementStopSync&amp;diff=29750</id>
		<title>OnElementStopSync</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnElementStopSync&amp;diff=29750"/>
		<updated>2012-03-28T23:06:52Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Fixed FabioGNR's changes and fixed example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Warning|In 1.1.x, Destroying the source of this event could crash the server!|true}}&lt;br /&gt;
&lt;br /&gt;
This event is triggered when an element is no longer synced by a player.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player oldSyncer&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''oldSyncer''': [[player]] element representing the last player who was syncing the element&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[element]] which is no longer synced by a player.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This script creates a vehicle in the center of the map and outputs a message to its old syncer if he is not syncing the vehicle anymore.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;server&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;
--create our testing vehicle onResourceStart&lt;br /&gt;
addEventHandler ( &amp;quot;onResourceStart&amp;quot;, getResourceRootElement( ),&lt;br /&gt;
function ( )&lt;br /&gt;
	vehicle = createVehicle ( 520, 0, 0, 0 )&lt;br /&gt;
end )&lt;br /&gt;
&lt;br /&gt;
function syncStop ( oldSyncer )&lt;br /&gt;
	-- check if the element that stopped being synced was our vehicle&lt;br /&gt;
	if source == vehicle then&lt;br /&gt;
		--tell the player (oldSyncer) he stopped syncing the vehicle&lt;br /&gt;
		outputChatBox ( &amp;quot;The vehicle is not being synced by you anymore&amp;quot;, oldSyncer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
--add the event handler&lt;br /&gt;
addEventHandler( &amp;quot;onElementStopSync&amp;quot;, getRootElement(), syncStop ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Element events}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29749</id>
		<title>DeleteResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29749"/>
		<updated>2012-03-28T22:54:01Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New feature/item|3.0120|1.2|3316|&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function deletes a resource from the MTA memory and moves it to the &amp;quot;/resources-cache/trash/&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function only works properly from 1.3.0-3912 (r3912). In case you are below r3912 you need to create a directory called &amp;quot;trash&amp;quot; inside of the &amp;quot;resources-cache&amp;quot; folder.&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 deleteResource ( string resourceName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' The name of resource to delete.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been deleted successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command to delete a certain resource (admins only, no spaces in resource name allowed).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;removeresource&amp;quot;,&lt;br /&gt;
function ( playerSource, commandName, name )&lt;br /&gt;
    --Check if it is an admin using this command&lt;br /&gt;
    if not isObjectInACLGroup ( &amp;quot;user.&amp;quot; .. getAccountName ( getPlayerAccount ( playerSource ) ), aclGetGroup ( &amp;quot;Admin&amp;quot; ) ) then&lt;br /&gt;
        outputChatBox ( &amp;quot;You are not allowed to use this command&amp;quot;, playerSource )&lt;br /&gt;
        return&lt;br /&gt;
    end &lt;br /&gt;
    --Did the user pass a valid resource name?&lt;br /&gt;
    if not name or name == &amp;quot;&amp;quot; or name == &amp;quot; &amp;quot; then&lt;br /&gt;
        outputChatBox ( &amp;quot;An invalid resource name has been passed (/removeresource &amp;lt;name&amp;gt;)&amp;quot;, playerSource )&lt;br /&gt;
        return&lt;br /&gt;
    end&lt;br /&gt;
    --Let us check if the resource name exists&lt;br /&gt;
    --Get all resources&lt;br /&gt;
    local resourceTable = getResources ( ) &lt;br /&gt;
    for resourceKey, resourceValue in ipairs ( resourceTable ) do&lt;br /&gt;
        local resourceName = getResourceName ( resourceValue )&lt;br /&gt;
        --Does the resource exist?&lt;br /&gt;
        if name == resourceName then&lt;br /&gt;
            --Stop the resource (maybe it is running)&lt;br /&gt;
            stopResource ( resourceValue )&lt;br /&gt;
            --Delete it&lt;br /&gt;
            local deleted = deleteResource ( name )&lt;br /&gt;
            if deleted then&lt;br /&gt;
                outputChatBox ( &amp;quot;Resource &amp;quot; .. name .. &amp;quot; has been successfully removed&amp;quot;, playerSource )&lt;br /&gt;
            else&lt;br /&gt;
                outputChatBox ( &amp;quot;There is an unknown problem with the resource&amp;quot;, playerSource )			&lt;br /&gt;
            end&lt;br /&gt;
            --The function is finished and was successful, return to stop it&lt;br /&gt;
            return&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    --If a resource with the specified name does not exist show an error message&lt;br /&gt;
    outputChatBox ( &amp;quot;The specified resource does not exist&amp;quot;, playerSource )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CopyResource&amp;diff=29748</id>
		<title>CopyResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CopyResource&amp;diff=29748"/>
		<updated>2012-03-28T22:38:38Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Added optional argument, fixed returns and added note about revision&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function copies a specified [[resource]] with a new name.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function only works properly from 1.3.0-3912 (r3912). In case you are below r3912 you need to create a directory called &amp;quot;trash&amp;quot; inside of the &amp;quot;resources-cache&amp;quot; folder .&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 copyResource ( resource theResource, string newResourceName[, string organizationalDir] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the resource which is going to be copied&lt;br /&gt;
*'''newResourceName:''' the name that the copied resource will receive&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''organizationalDir''': A string containing the path where the resource should be copied to (e.g. &amp;quot;[gamemodes]/[amx]&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns the [[resource]] element that was copied. Returns ''false'' if the arguments are incorrect&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- This script can backup your resource with a easy command! /backupresource [resourcename]&lt;br /&gt;
function backupResource (player,command,resourcetobackup) -- start the function&lt;br /&gt;
  if (resourcetobackup) and (getResourceFromName(resourcetobackup)) then -- check if the resource is exist&lt;br /&gt;
    copyResource (getResourceFromName(resourcetobackup),resourcetobackup .. &amp;quot;_backup&amp;quot;) -- copy the resource and give it the name [resource]_backup&lt;br /&gt;
    outputChatBox (&amp;quot;Resource &amp;quot; .. resourcetobackup .. &amp;quot; succesfully backed up!&amp;quot;,player,255,0,0,false) -- say it's OK!&lt;br /&gt;
  else -- if it isn't exist&lt;br /&gt;
    outputChatBox (&amp;quot;Resource can't be backed up! (don't forget the parameters!)&amp;quot;,player,255,0,0,false) -- say it isn't exist!&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler (&amp;quot;backupresource&amp;quot;,backupResouce) -- add command&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=29644</id>
		<title>User:-ffs-Sniper</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=29644"/>
		<updated>2012-03-17T10:40:07Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome, this is -ffs-Sniper, co leader of the |FFS|Gaming community, No 1 in DD/DM racing.&lt;br /&gt;
Most people know me as SHC//Sniper, the former founder and leader of the SHC clan.&lt;br /&gt;
&lt;br /&gt;
Source patches:&lt;br /&gt;
 -http://code.google.com/p/mtasa-blue/source/detail?r=3909&lt;br /&gt;
&lt;br /&gt;
Wiki updates:&lt;br /&gt;
 -[[GetRainLevel]]&lt;br /&gt;
 -[[SetRainLevel]]&lt;br /&gt;
 -[[ResetRainLevel]]&lt;br /&gt;
 -[[DeleteResource]]&lt;br /&gt;
 -and a lot more&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29643</id>
		<title>DeleteResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29643"/>
		<updated>2012-03-17T10:36:23Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Small update for the example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New feature/item|3.0120|1.2|3316|&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function deletes a resource from the MTA memory and moves it to the &amp;quot;/resources-cache/trash/&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function only works properly from 1.3.0-3912 (r3912). In case you are below r3912 you need to create a directory called &amp;quot;trash&amp;quot; inside of the &amp;quot;resources-cache&amp;quot; folder.&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 deleteResource ( string resourceName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' The name of resource to delete.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been deleted successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command to delete a certain resource (admins only, no spaces in resource name allowed).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;removeresource&amp;quot;,&lt;br /&gt;
function( playerSource, commandName, name )&lt;br /&gt;
    --Check if it is an admin using this command&lt;br /&gt;
    if not isObjectInACLGroup ( &amp;quot;user.&amp;quot; .. getAccountName ( getPlayerAccount ( playerSource ) ), aclGetGroup ( &amp;quot;Admin&amp;quot; ) ) then&lt;br /&gt;
        outputChatBox ( &amp;quot;You are not allowed to use this command&amp;quot;, playerSource )&lt;br /&gt;
        return&lt;br /&gt;
    end &lt;br /&gt;
    --Did the user pass a valid resource name?&lt;br /&gt;
    if not name or name == &amp;quot;&amp;quot; or name == &amp;quot; &amp;quot; then&lt;br /&gt;
        outputChatBox ( &amp;quot;An invalid resource name has been passed (/removeresource &amp;lt;name&amp;gt;)&amp;quot;, playerSource )&lt;br /&gt;
        return&lt;br /&gt;
    end&lt;br /&gt;
    --Let us check if the resource name exists&lt;br /&gt;
    --Get all resources&lt;br /&gt;
    local resourceTable = getResources ( ) &lt;br /&gt;
    for resourceKey, resourceValue in ipairs ( resourceTable ) do&lt;br /&gt;
        local resourceName = getResourceName ( resourceValue )&lt;br /&gt;
        --Does the resource exist?&lt;br /&gt;
        if name == resourceName then&lt;br /&gt;
            --Stop the resource (maybe it is running)&lt;br /&gt;
            stopResource ( resourceValue )&lt;br /&gt;
            --Delete it&lt;br /&gt;
            local deleted = deleteResource ( name )&lt;br /&gt;
            if deleted then&lt;br /&gt;
                outputChatBox ( &amp;quot;Resource &amp;quot; .. name .. &amp;quot; has been successfully removed&amp;quot;, playerSource )&lt;br /&gt;
            else&lt;br /&gt;
                outputChatBox ( &amp;quot;There is an unknown problem with the resource&amp;quot;, playerSource )			&lt;br /&gt;
            end&lt;br /&gt;
            --The function is finished and was successful, return to stop it&lt;br /&gt;
            return&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    --If a resource with the specified name does not exist show an error message&lt;br /&gt;
    outputChatBox ( &amp;quot;The specified resource does not exist&amp;quot;, playerSource )&lt;br /&gt;
end )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29642</id>
		<title>DeleteResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29642"/>
		<updated>2012-03-17T10:25:28Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Completely wrong example replaced by a useful and working example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New feature/item|3.0120|1.2|3316|&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function deletes a resource from the MTA memory and moves it to the &amp;quot;/resources-cache/trash/&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function only works properly from 1.3.0-3912 (r3912). In case you are below r3912 you need to create a directory called &amp;quot;trash&amp;quot; inside of the &amp;quot;resources-cache&amp;quot; folder.&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 deleteResource ( string resourceName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' The name of resource to delete.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been deleted successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command to delete a certain resource (admins only, no spaces in resource name allowed).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;removeresource&amp;quot;,&lt;br /&gt;
function(player, cmd, name)&lt;br /&gt;
    --Check if it is an admin using this command&lt;br /&gt;
    if not (isObjectInACLGroup(&amp;quot;user.&amp;quot;..getAccountName(getPlayerAccount(player)),aclGetGroup(&amp;quot;Admin&amp;quot;))) then&lt;br /&gt;
        outputChatBox(&amp;quot;You are not allowed to use this command&amp;quot;, player)&lt;br /&gt;
        return&lt;br /&gt;
    end &lt;br /&gt;
    --Did the user pass a valid resource name?&lt;br /&gt;
    if not (name) or (name == &amp;quot;&amp;quot;) and (name == &amp;quot; &amp;quot;) then&lt;br /&gt;
        outputChatBox(&amp;quot;An invalid resource name has been passed (/removeresource &amp;lt;name&amp;gt;)&amp;quot;, player)&lt;br /&gt;
        return&lt;br /&gt;
    end&lt;br /&gt;
    --Let us check if the resource name exists&lt;br /&gt;
    --Get all resources&lt;br /&gt;
    local resourceTable = getResources() &lt;br /&gt;
    for resourceKey, resourceValue in ipairs(resourceTable) do&lt;br /&gt;
        local resourceName = getResourceName(resourceValue)&lt;br /&gt;
        --Does the resource exist?&lt;br /&gt;
        if (name == resourceName) then&lt;br /&gt;
            --Stop the resource (maybe it is running)&lt;br /&gt;
            stopResource(resourceValue)&lt;br /&gt;
            --Delete it&lt;br /&gt;
            local deleted = deleteResource(name)&lt;br /&gt;
            if (deleted) then&lt;br /&gt;
                outputChatBox(&amp;quot;Resource &amp;quot;..name..&amp;quot; has been successfully removed&amp;quot;, player)&lt;br /&gt;
            else&lt;br /&gt;
                outputChatBox(&amp;quot;There is an unknown problem with the resource&amp;quot;, player)			&lt;br /&gt;
            end&lt;br /&gt;
            --The function is finished and was successful, return to stop it&lt;br /&gt;
            return&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    --If a resource with the specified name does not exist show an error message&lt;br /&gt;
    outputChatBox(&amp;quot;The specified resource does not exist&amp;quot;, player)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29637</id>
		<title>DeleteResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29637"/>
		<updated>2012-03-15T21:59:19Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Wrong revision number, updated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New feature/item|3.0120|1.2|3316|&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function deletes a resource from the MTA memory and moves it to the &amp;quot;/resources-cache/trash/&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function only works properly from 1.3.0-3912 (r3912). In case you are below r3912 you need to create a directory called &amp;quot;trash&amp;quot; inside of the &amp;quot;resources-cache&amp;quot; folder.&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 deleteResource ( string resourceName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' The name of resource to delete.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been deleted successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example checks to see if there's 2 resources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;,getResourceRootElement(getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
   resources = getResources() --Get all resources&lt;br /&gt;
   if (getResourceState(resources) == &amp;quot;loaded&amp;quot; and &amp;quot;running&amp;quot; or &amp;quot;loaded&amp;quot; and &amp;quot;starting&amp;quot;) then --Checks to see if there's to resources that's loaded and running or loaded and starting up&lt;br /&gt;
    stopResource(resources)&lt;br /&gt;
    deleteResource(resources)&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29636</id>
		<title>DeleteResource</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DeleteResource&amp;diff=29636"/>
		<updated>2012-03-15T21:18:48Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New feature/item|3.0120|1.2|3316|&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function deletes a resource from the MTA memory and moves it to the &amp;quot;/resources-cache/trash/&amp;quot; directory.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' This function only works properly from 1.3.0-3909 (r3909). In case you are below r3909 you need to create a directory called &amp;quot;trash&amp;quot; inside of the &amp;quot;resources-cache&amp;quot; folder.&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 deleteResource ( string resourceName )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''resourceName:''' The name of resource to delete.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the resource has been deleted successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example checks to see if there's 2 resources.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;,getResourceRootElement(getThisResource()),&lt;br /&gt;
function()&lt;br /&gt;
   resources = getResources() --Get all resources&lt;br /&gt;
   if (getResourceState(resources) == &amp;quot;loaded&amp;quot; and &amp;quot;running&amp;quot; or &amp;quot;loaded&amp;quot; and &amp;quot;starting&amp;quot;) then --Checks to see if there's to resources that's loaded and running or loaded and starting up&lt;br /&gt;
    stopResource(resources)&lt;br /&gt;
    deleteResource(resources)&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.1.1-9.03316|n/a|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FromJSON&amp;diff=29635</id>
		<title>FromJSON</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FromJSON&amp;diff=29635"/>
		<updated>2012-03-15T20:39:58Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Needs_Checking|Example 1 does not work. FromJSON is not compatible with JSON objects such as &amp;quot;cat:5, mouse:1&amp;quot;. You might only use JSON arrays instead or move the JSON formatting to PHP --[[User:-ffs-Sniper|-ffs-Sniper]] 20:39, 15 March 2012 (UTC)}} &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;
This function parses a [[JSON]] formatted string into variables. You can use [[toJSON]] to encode variables into a JSON string that can be read by this function.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
var fromJSON ( string json )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''json:''' A JSON formatted string&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns variables read from the JSON string.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This should make data equal: {1=&amp;quot;cat&amp;quot;, 2=&amp;quot;mouse&amp;quot;, 3=5, 4=null, 5={cat=5, mouse=1}} (untested)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local data = fromJSON(&amp;quot;[\&amp;quot;cat\&amp;quot;, \&amp;quot;mouse\&amp;quot;, 5, null, {cat:5, mouse:1}]&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example 2==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local name, weapon, ammo = fromJSON(&amp;quot;[\&amp;quot;Desert Eagle\&amp;quot;, 24, 147]&amp;quot;)&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>-ffs-Sniper</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=29634</id>
		<title>User:-ffs-Sniper</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:-ffs-Sniper&amp;diff=29634"/>
		<updated>2012-03-15T20:27:32Z</updated>

		<summary type="html">&lt;p&gt;-ffs-Sniper: Created page with &amp;quot;Welcome, this is -ffs-Sniper, co leader of the |FFS|Gaming community, No 1 in DD/DM racing. Most people know me as SHC//Sniper, the former founder and leader of the SHC clan.  So...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome, this is -ffs-Sniper, co leader of the |FFS|Gaming community, No 1 in DD/DM racing.&lt;br /&gt;
Most people know me as SHC//Sniper, the former founder and leader of the SHC clan.&lt;br /&gt;
&lt;br /&gt;
Source patches:&lt;br /&gt;
 -http://code.google.com/p/mtasa-blue/source/detail?r=3909&lt;br /&gt;
&lt;br /&gt;
Wiki updates:&lt;br /&gt;
 -[[GetRainLevel]]&lt;br /&gt;
 -[[SetRainLevel]]&lt;br /&gt;
 -[[ResetRainLevel]]&lt;br /&gt;
 -and a lot more&lt;/div&gt;</summary>
		<author><name>-ffs-Sniper</name></author>
	</entry>
</feed>