<?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=Snert</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=Snert"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Snert"/>
	<updated>2026-04-24T00:14:47Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleSirenParams&amp;diff=30267</id>
		<title>GetVehicleSirenParams</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleSirenParams&amp;diff=30267"/>
		<updated>2012-05-03T14:38:23Z</updated>

		<summary type="html">&lt;p&gt;Snert: /* Returns */ Hopefully cleared up the return table for this function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|4.0140|1.4|3966|&lt;br /&gt;
This function get the parameters of a vehicles siren.&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;
table getVehicleSirenParams ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle to get the siren parameters of&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' with the siren count, siren type and a sub table for the four flags. False otherwise.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
[int]   SirenParams.SirenCount&lt;br /&gt;
[int]   SirenParams.SirenType&lt;br /&gt;
[table] SirenParams.Flags&lt;br /&gt;
 [bool] SirenParams.Flags[&amp;quot;360&amp;quot;]&lt;br /&gt;
 [bool] SirenParams.Flags.DoLOSCheck&lt;br /&gt;
 [bool] SirenParams.Flags.UseRandomiser&lt;br /&gt;
 [bool] SirenParams.Flags.Silent&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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 returns the vehicle parameters when the players presses g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onVehicleEnter&amp;quot;,root,function(player,seat)&lt;br /&gt;
   if(player)and(seat==0)then&lt;br /&gt;
      addVehicleSirens(source,1,1)&lt;br /&gt;
      setVehicleSirens(source,1,0,0,0,100,0,100,255,122)&lt;br /&gt;
      bindKey(player,&amp;quot;g&amp;quot;,&amp;quot;up&amp;quot;,getSiren,source)&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
 &lt;br /&gt;
function getSiren(player,button,state,vehicle)&lt;br /&gt;
   local sirenParams = getVehicleSirenParams(vehicle)&lt;br /&gt;
   outputChatBox(&amp;quot;Here's the parameters of your vehicle sirens: Siren Points: &amp;quot;..tostring(sirenParams.SirenCount)..&amp;quot;, Type of Siren: &amp;quot;..tostring(sirenParams.SirenType)..&amp;quot;.&amp;quot;,player)&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onVehicleExit&amp;quot;,root,function(player,seat)&lt;br /&gt;
   if(player)and(seat==0)then&lt;br /&gt;
      removeVehicleSirens(source)&lt;br /&gt;
      unbindKey(player,&amp;quot;g&amp;quot;,&amp;quot;up&amp;quot;,getSiren)&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.4-3966|1.4-3966|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleSirenParams&amp;diff=30266</id>
		<title>GetVehicleSirenParams</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleSirenParams&amp;diff=30266"/>
		<updated>2012-05-03T14:29:50Z</updated>

		<summary type="html">&lt;p&gt;Snert: /* Example */  To example maker: Try to figure out why an example would return nil before actually posting it. A faulty example is as good as no example at all.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{New feature/item|4.0140|1.4|3966|&lt;br /&gt;
This function get the parameters of a vehicles siren.&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;
table getVehicleSirenParams ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle to get the siren parameters of&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' with the siren count, siren type and a sub table for the four flags. False otherwise.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
sirenParams = { sirenCount, sirenType, { is360, doLOSCheck, useRandomiser, silent } }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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 returns the vehicle parameters when the players presses g.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onVehicleEnter&amp;quot;,root,function(player,seat)&lt;br /&gt;
   if(player)and(seat==0)then&lt;br /&gt;
      addVehicleSirens(source,1,1)&lt;br /&gt;
      setVehicleSirens(source,1,0,0,0,100,0,100,255,122)&lt;br /&gt;
      bindKey(player,&amp;quot;g&amp;quot;,&amp;quot;up&amp;quot;,getSiren,source)&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
 &lt;br /&gt;
function getSiren(player,button,state,vehicle)&lt;br /&gt;
   local sirenParams = getVehicleSirenParams(vehicle)&lt;br /&gt;
   outputChatBox(&amp;quot;Here's the parameters of your vehicle sirens: Siren Points: &amp;quot;..tostring(sirenParams.SirenCount)..&amp;quot;, Type of Siren: &amp;quot;..tostring(sirenParams.SirenType)..&amp;quot;.&amp;quot;,player)&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
addEventHandler(&amp;quot;onVehicleExit&amp;quot;,root,function(player,seat)&lt;br /&gt;
   if(player)and(seat==0)then&lt;br /&gt;
      removeVehicleSirens(source)&lt;br /&gt;
      unbindKey(player,&amp;quot;g&amp;quot;,&amp;quot;up&amp;quot;,getSiren)&lt;br /&gt;
   end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.4-3966|1.4-3966|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Shader_examples&amp;diff=26628</id>
		<title>Shader examples</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Shader_examples&amp;diff=26628"/>
		<updated>2011-08-06T11:21:55Z</updated>

		<summary type="html">&lt;p&gt;Snert: /* Block world */  Added note of how to get this shader working (Can anyone with access to the original ZIP file please fix this?)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page contains some example shader resources to try in 1.1. If you are looking to make your own, please be sure to read about the [[Shader|shader element]] as well.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
==Road shine==&lt;br /&gt;
[[Image:RoadShineScreen.jpg|200px|thumb|left|Road shine]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_roadshine.zip Download shader_roadshine.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource creates a light reflection effect on the ground (looks best when moving). &lt;br /&gt;
It uses a custom flag in the effect file to generate [http://en.wikipedia.org/wiki/Surface_normal surface normals] for the ground model:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int CUSTOMFLAGS&lt;br /&gt;
&amp;lt;&lt;br /&gt;
    string createNormals = &amp;quot;yes&amp;quot;;&lt;br /&gt;
&amp;gt;;&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Surface normals are not usually present in the ground and building models, but are useful for creating lighting effects such as these.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Road shine 2==&lt;br /&gt;
[[Image:RoadShine2Screen.jpg|200px|thumb|left|Road shine 2]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_roadshine2.zip Download shader_roadshine2.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Bit more complicated than the first Road shine, as it tracks the sun or moon to calculate the position of the highlight.&lt;br /&gt;
The effect can be hard to see depending on the time of day.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Best used with the play resource as the model it modifies is near the initial spawn point.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UV scroll==&lt;br /&gt;
[[Image:UVScollScreen.jpg|200px|thumb|left|UV scroll]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_uv_scroll.zip Download shader_uv_scroll.zip]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource scrolls a texture from left to right. It doesn't use vertex or pixels shaders, so it should work on all hardware.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==UV scripted==&lt;br /&gt;
[[Image:UVScriptedScreen.jpg|200px|thumb|left|UV scripted]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_uv_scripted.zip Download shader_uv_scripted.zip]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource controls a texture's UVs using Lua. It shows that anything is possible if you can imagine it.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Ped morph==&lt;br /&gt;
[[Image:PedMorphScreen.jpg|200px|thumb|left|Ped morph]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_ped_morph.zip Download shader_ped_morph.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource uses a vertex shader to modify the geometry of a ped model as it is rendered.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
When the resource has started, use the 'k' and 'l' keys to change morph size. If you change your player's skin, restart the resource to modify the new model.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Ped shell==&lt;br /&gt;
[[Image:PedShellScreen.jpg|200px|thumb|left|Ped shell]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_ped_shell.zip Download shader_ped_shell.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource draws a translucent effect in a second render pass. The first pass is done by GTA, and the vertex shader is only applied in the second to add the effect 'on top' of the standard output.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
When the resource has started, use the 'k' key to see the shell effect. If you change your player's skin, restart the resource to see the effect applied to the new model.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Car paint==&lt;br /&gt;
[[Image:CarPaintScreen.jpg|200px|thumb|left|Car paint]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_car_paint.zip Download shader_car_paint.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource shows you how to apply a shader to the vehicle models. The shader itself is not that great, so don't get your hopes up.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Water==&lt;br /&gt;
[[Image:WaterScreen.jpg|200px|thumb|left|Water]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_water.zip Download shader_water.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource applies a shader to the GTA world water. The Lua script shows how to use a timer to transfer the conventional water color setting to the shader.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Bloom==&lt;br /&gt;
[[Image:BloomScreen.jpg|200px|thumb|left|Bloom]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_bloom.zip Download shader_bloom.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource shows you how 'bounce' full screen effects using a render target pool. It also uses the new ''onClientHUDRender'' event to exclude the HUD from the effect.&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Block world==&lt;br /&gt;
[[Image:BlockWorld.jpg|200px|thumb|left|Block world]]&lt;br /&gt;
&amp;lt;table border=0&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td valign=top height=170&amp;gt;&lt;br /&gt;
[http://nightly.mtasa.com/files/shaders/shader_block_world.zip Download block_world.zip] &amp;amp;nbsp; ''Requires Shader Model 2 graphics card''&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
This resource makes the textures look all blocky. It also changes colors when the 'k' key is pressed.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
'''Note:''' The script currently uses the wrong name for the shader file. To fix this, replace the two instances of:&lt;br /&gt;
&lt;br /&gt;
  color_world.fx&lt;br /&gt;
&lt;br /&gt;
with:&lt;br /&gt;
&lt;br /&gt;
  block_world.fx&lt;br /&gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientHUDRender&amp;diff=26456</id>
		<title>OnClientHUDRender</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientHUDRender&amp;diff=26456"/>
		<updated>2011-08-01T10:28:18Z</updated>

		<summary type="html">&lt;p&gt;Snert: Created page with &amp;quot;__NOTOC__ {{Client event}}  This event is triggered before GTA renders the HUD. This is particularly useful if you want to use dxUpdateScreenSource to capture the screen onto...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client event}} &lt;br /&gt;
This event is triggered before GTA renders the HUD. This is particularly useful if you want to use [[dxUpdateScreenSource]] to capture the screen onto a texture without capturing the HUD, or to alter HUD textures using [[Element/Shader|shaders]] before they are drawn onto the screen.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
''None''&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the client's [[root element]].&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;
===Other client events===&lt;br /&gt;
{{Client_other_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=DxSetRenderTarget&amp;diff=26455</id>
		<title>DxSetRenderTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=DxSetRenderTarget&amp;diff=26455"/>
		<updated>2011-08-01T10:18:46Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
Only available in 1.1&lt;br /&gt;
}}&lt;br /&gt;
This function changes the drawing destination for the dx functions. It can be used to select a previously created render target, or if called with no arguments, restore drawing directly to the screen.&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 dxSetRenderTarget ( [ element renderTarget, bool clear = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
If no arguments are supplied, the screen is restored as the drawing destination.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''renderTarget:''' The render target element whose pixels we want to draw on.&lt;br /&gt;
*'''clear:''' If set to true, the render target will also be cleared.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the render target was successfully changed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Usage restrictions==&lt;br /&gt;
*dxSetRenderTarget can only be called during the [[onClientRender]] and [[onClientHUDRender]] events.&lt;br /&gt;
*Items drawn with ''postGUI'' set to ''true'' will not appear on a custom render target.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot,&lt;br /&gt;
    function()&lt;br /&gt;
        myRenderTarget = dxCreateRenderTarget( 80, 100 )  -- Create a render target texture which is 80 x 100 pixels&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        if myRenderTarget then&lt;br /&gt;
            dxSetRenderTarget( myRenderTarget )  -- Select custom render target&lt;br /&gt;
            dxDrawText ( &amp;quot;Hello&amp;quot;, 10, 20 )       -- The message 'Hello' will be drawn on myRenderTarget&lt;br /&gt;
&lt;br /&gt;
            dxSetRenderTarget()                  -- Select default render target&lt;br /&gt;
            dxDrawText ( &amp;quot;Goodbye&amp;quot;, 10, 20 )     -- The message 'Goodbye' will be drawn directly to the screen&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Drawing_functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetWaterColor&amp;diff=26176</id>
		<title>GetWaterColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetWaterColor&amp;diff=26176"/>
		<updated>2011-06-25T22:22:31Z</updated>

		<summary type="html">&lt;p&gt;Snert: Undo revision 26172 by Kamek (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the water color of the GTA world.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The server can only return the water color, if it has actually been set by script.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int, int, int, int getWaterColor ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns 4 [[int|ints]], indicating the color of the water. (RGBA)&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;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiComboBoxSetSelected&amp;diff=26132</id>
		<title>GuiComboBoxSetSelected</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiComboBoxSetSelected&amp;diff=26132"/>
		<updated>2011-06-23T21:01:44Z</updated>

		<summary type="html">&lt;p&gt;Snert: Undo revision 26127 by SuN (talk) (Ever noticed that this function is about comboboxes, not checkboxes?)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the selected item from a combobox.&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 guiComboBoxSetSelected ( element comboBox, int itemIndex )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''comboBox:''' the combobox you want to select an item from&lt;br /&gt;
*'''itemIndex:''' the item you want to select (item 0 is the first item). If -1 is specified, then the combo box text is set to it's ''caption''.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the selected item has been changed successfully, ''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;
--Todo..&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GuiComboBoxSetSelected&amp;diff=26131</id>
		<title>GuiComboBoxSetSelected</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GuiComboBoxSetSelected&amp;diff=26131"/>
		<updated>2011-06-23T21:00:27Z</updated>

		<summary type="html">&lt;p&gt;Snert: Undo revision 26128 by SuN (talk) (Broken attempt to fix a broken example)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the selected item from a combobox.&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 guiComboBoxSetSelected ( element comboBox, int itemIndex )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''comboBox:''' the combobox you want to select an item from&lt;br /&gt;
*'''itemIndex:''' the item you want to select (item 0 is the first item). If -1 is specified, then the combo box text is set to it's ''caption''.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the selected item has been changed successfully, ''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 createChecks()&lt;br /&gt;
cehck1 = guiCreateCheckBox(20,30,150,20,&amp;quot;Checked checkbox&amp;quot;,true,false,guiWindow)&lt;br /&gt;
guiComboBoxSetSelected ( cehck1 , 1 )&lt;br /&gt;
cehck2 = guiCreateCheckBox(20,60,150,20,&amp;quot;Unchecked checkbox&amp;quot;,false,false,guiWindow)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, getResourceRootElement(getThisResource()), createChecks)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI functions}}&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetSoundMetaTags&amp;diff=26130</id>
		<title>GetSoundMetaTags</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetSoundMetaTags&amp;diff=26130"/>
		<updated>2011-06-23T20:58:14Z</updated>

		<summary type="html">&lt;p&gt;Snert: Undo revision 26129 by SuN (talk) (Completely broken and useless example. Learn what this function does and test your example properly)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
Used to get the meta tags attached to a sound. These provide information about the sound, for instance the title or the artist.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getSoundMetaTags ( element sound )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''sound:''' a [[sound]] element.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[table]] with all data available (keys are listed below) for the sound if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{Sound_Meta_Tags}}&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;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=25890</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=25890"/>
		<updated>2011-05-23T19:43:04Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
===Runcode++===&lt;br /&gt;
&lt;br /&gt;
Guess you should be able to guess it's related to runcode, but it's not a simple command. It's a GUI version of Runcode, with functions like:&lt;br /&gt;
&lt;br /&gt;
* Multi-line input&lt;br /&gt;
* Being able to save and load script files&lt;br /&gt;
* Being able to edit multiple script files at the same time&lt;br /&gt;
&lt;br /&gt;
Please note that this is an old resource of mine, and I'm just releasing it because it might be useful for development or someone might simply like the idea. I'm planning to continue on this if there's some sort of getFilesAtLocation to store script files client-side, without hassle.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/advruncode.zip Download] ('''Note:''' Work-in-progress, old and not extensively tested)&lt;br /&gt;
&lt;br /&gt;
==Other potentially useful stuff==&lt;br /&gt;
&lt;br /&gt;
===SA Weather table===&lt;br /&gt;
&lt;br /&gt;
I'm trying to make the timecyc.dat file a lot more readable, mostly for me to be able to make new functions. But I guess it might be useful to scripters as well, if they're for instance intending to use the weather functions to create their own weather system.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/SA%20Weather%20Table.xlsx Download] ('''Note:''' Work-in-progress)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getAllAccountData ( account theAccount )&lt;br /&gt;
bool setAllAccountData ( account theAccount, table theData )&lt;br /&gt;
&lt;br /&gt;
bool setVehicleAdjustableProperty ( element theVehicle, int value )&lt;br /&gt;
int getVehicleAdjustableProperty ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. There seems to be a function for this in the source&lt;br /&gt;
areStreetLightsEnabled ( )&lt;br /&gt;
areBackgroundGunshotsEnabled ( )&lt;br /&gt;
areBirdsEnabled ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater. Gotta find a way to set it for all peds, not just for the local player&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreate ( ) -- Triggered when an element was created&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreate ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Nitro builds==&lt;br /&gt;
&lt;br /&gt;
TODO:&lt;br /&gt;
&lt;br /&gt;
* Fix issue where activating NOS without actually having NOS installed would make the car act extremely weird&lt;br /&gt;
* Add a function to allow players to re-activate NOS while it's recharging&lt;br /&gt;
* Add events&lt;br /&gt;
* Sync nitro to remote players (only on/off state would be necessary for remote players, I guess)&lt;br /&gt;
* Fix some more stuff&lt;br /&gt;
* Commit, document, and all that&lt;br /&gt;
&lt;br /&gt;
Work-in-progress patch: http://dl.dropbox.com/u/4504893/patches/nitro.patch&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
setRainLevel&lt;br /&gt;
setFogDistance&lt;br /&gt;
setSunColor&lt;br /&gt;
setSunSize&lt;br /&gt;
setFarClipDistance&lt;br /&gt;
setHeatHaze&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setLightningEnabled&lt;br /&gt;
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it&lt;br /&gt;
setSandStormEnabled&lt;br /&gt;
&lt;br /&gt;
-- Some more stuff that might be good to give scripters control of (all from timecyc.dat)&lt;br /&gt;
setAmbienceColor -- Sets the color (filter) of objects (or so I assume)&lt;br /&gt;
setDirectLightColor -- Sets the color (filter) of vehicles and peds&lt;br /&gt;
setSpriteBrightness&lt;br /&gt;
setShadowIntensity&lt;br /&gt;
setLightShadingValue&lt;br /&gt;
setLightOnGround&lt;br /&gt;
setLowerCloudColor -- NOTE: It is assumed that this is the clouds which sort of fly around low, the type of clouds which aren't disabled yet by setCloudsEnabled. Thus, important&lt;br /&gt;
setUpperCloudColor&lt;br /&gt;
setColorCorrection&lt;br /&gt;
&lt;br /&gt;
-- Prolly the heck of a lot more&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MTA proposals==&lt;br /&gt;
&lt;br /&gt;
===Getting contents of folders===&lt;br /&gt;
&lt;br /&gt;
The current system for files is fine, but it could be better. For instance, there's no way to know what files are in a folder, unless you specifically try to keep track of them. In most cases this is fine, but it could of course be very useful in some cases to be able to locate all files / folders inside a specific folder.&lt;br /&gt;
&lt;br /&gt;
====Proposed functions====&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Names pending&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getFilesAtLocation&lt;br /&gt;
getFoldersAtLocation&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Possible uses====&lt;br /&gt;
&lt;br /&gt;
* Radio scripts could easily allow players adding their own music, without having to edit a XML file or any manual setup&lt;br /&gt;
* Script editors could immediately detect all available scripts without having to inspect the meta.xml&lt;br /&gt;
* Scripts will be able to store things like replay files without having to keep track of them in an XML file&lt;br /&gt;
&lt;br /&gt;
====Obstacles====&lt;br /&gt;
&lt;br /&gt;
* It should be compatible with both Linux and Windows server-side. Client-side windows only isn't an issue, but on the server it is&lt;br /&gt;
* Filepaths were always intended to point towards individual files instead of folders. A workaround for this should be found, if there functions were to be added&lt;br /&gt;
* Possibly some other stuff&lt;br /&gt;
&lt;br /&gt;
====Basic hackpatch====&lt;br /&gt;
&lt;br /&gt;
I've attempted to make support for these functions a few days ago. I actually &amp;quot;succeeded&amp;quot; in it, client-side only, getFilesAtLocation only and very hackily implemented. But oh well, it'd give the general idea.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/getFilesAtLocation.patch Download]&lt;br /&gt;
&lt;br /&gt;
Example usage:&lt;br /&gt;
&lt;br /&gt;
  crun getFilesAtLocation(&amp;quot;:runcode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
What's wrong with just exporting the POSIX functions into MTA? Could even make them Lua iterators, so you could do for entry in directory(&amp;quot;:runcode&amp;quot;) do print(entry.name .. &amp;quot;, file? &amp;quot; .. entry.isFile) end --[[User:Alberto Alonso|Alberto Alonso]] 03:15, 21 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Serverlist independence===&lt;br /&gt;
&lt;br /&gt;
The server browser has always been an issue in MTA. People often complain about game-monitor being down or just being plain slow. Also, servers only show up on game-monitor after a long amount of uptime, or sometimes they don't show up at all. So, we'll need to change something. That's for sure.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' I didn't do a lot of reseach as to how it works currently&lt;br /&gt;
&lt;br /&gt;
====My proposal====&lt;br /&gt;
&lt;br /&gt;
In short: Support third-party server browsers&lt;br /&gt;
&lt;br /&gt;
In a bit more detail:&lt;br /&gt;
&lt;br /&gt;
* Servers will get new options in which they'll be able to make their own list of server browsers they want to appear on&lt;br /&gt;
* Clients will get a new GUI in which they'll be able to make their own list of server browsers to request the server lists from&lt;br /&gt;
* The server will update all server browsers in its list periodically (and at startup, of course)&lt;br /&gt;
* The client can now check out all server browsers, and merge all results into a list&lt;br /&gt;
&lt;br /&gt;
This should remove dependency on specific server browsers, and therefore it should make the server browser so much more useful. (Because of less downtime and probably fuller serverlists)&lt;br /&gt;
&lt;br /&gt;
====Problems to overcome====&lt;br /&gt;
&lt;br /&gt;
* The server should not wait for the server browser query to be completed&lt;br /&gt;
** Each server browser should get its own update thread, to ensure they won't block eachother either&lt;br /&gt;
* The merging of the server browsers at the client might be tricky. You'd have to know which entry is the most recent one, and use that, while not waiting until all browsers have finally returned their results&lt;br /&gt;
** Not sure how the server browser works currently, but in case the client queries the data directly from the MTA server, ignore this. If not, it would still be a good idea&lt;br /&gt;
* There should be multiple official server lists&lt;br /&gt;
* All server lists should use the same protocol&lt;br /&gt;
&lt;br /&gt;
====Other stuff====&lt;br /&gt;
&lt;br /&gt;
Servers should have a setting like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;serverlists&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.game-monitor.com&amp;quot;/&amp;gt; &amp;lt;!-- not sure bout the link itself, but it's the general idea --&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.mtasa.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.mtaserverlist.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/serverlists&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Client-side there should also be a GUI for this, with the possibility to name specific server browsers to make organising the list a lot easier. It should also list stuff like average ping, results and downtime, for convenience. Also, it would be useful to have another GUI which will fetch a list of server browsers from the internet, so people can quickly add new server browsers, or re-add official server browsers they previously removed.&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
Variables I've discovered through playing around with Cheat Engine&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables. Got these from Cheat Engine as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
! Assembly&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
| mov byte ptr [edi+008e4cd0],02&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
| mov byte ptr [ebp+10],03&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
| mov byte ptr [ebx+008e4cd0],01&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TODOcument==&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getRainLevel ( )&lt;br /&gt;
setRainLevel ( float rainLevel )&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
getFogDistance ( )&lt;br /&gt;
setFogDistance ( float distance )&lt;br /&gt;
resetFogDistance ( )&lt;br /&gt;
&lt;br /&gt;
getFarClipDistance ( )&lt;br /&gt;
setFarClipDistance ( float distance )&lt;br /&gt;
resetFarClipDistance ( )&lt;br /&gt;
&lt;br /&gt;
getSunColor ( )&lt;br /&gt;
setSunColor ( [ int coreR, int coreG, int coreB, int coronaR, int coronaG, int coronaB ] )&lt;br /&gt;
resetSunColor ( )&lt;br /&gt;
&lt;br /&gt;
getSunSize ( )&lt;br /&gt;
setSunSize ( float size )&lt;br /&gt;
resetSunSize ( )&lt;br /&gt;
&lt;br /&gt;
areInteriorSoundsEnabled ( )&lt;br /&gt;
setInteriorSoundsEnabled ( bool enabled )&lt;br /&gt;
&lt;br /&gt;
isElementFrozen ( element theElement ) -- Also mark the functions it replaced as &amp;quot;deprecated&amp;quot;&lt;br /&gt;
setElementFrozen ( element theElement, bool frozen ) -- Same here, of course&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Element map properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Vehicle:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Ped:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Object:&lt;br /&gt;
&lt;br /&gt;
- frozen     = bool frozen&lt;br /&gt;
- collisions = bool collisionsEnabled&lt;br /&gt;
- scale      = float objectScale&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleHandling&amp;diff=25736</id>
		<title>SetVehicleHandling</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleHandling&amp;diff=25736"/>
		<updated>2011-05-07T10:42:11Z</updated>

		<summary type="html">&lt;p&gt;Snert: Tidied the example up a bit, with proper feedback&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}} &lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function is used to change the handling data of a vehicle.&lt;br /&gt;
&lt;br /&gt;
''*'''Note:''' This function has not merged into the 1.1 nightly builds yet! It will only work if you have a custom build of the handling branch.''&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 setVehicleHandling ( element theVehicle, string property, int/float/bool/table value ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to set the handling of.&lt;br /&gt;
*'''property:''' The property you wish to set the handling of the vehicle to.&lt;br /&gt;
*'''value:''' The value of the property you wish to set the handling of the vehicle to.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the handling was set successfully, ''false'' otherwise. See below a list of valid propertys and their required values:&lt;br /&gt;
{{Handling Properties}}&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 massChange ( me, command, mass )&lt;br /&gt;
    mass = tonumber ( mass ) -- Convert mass to a number&lt;br /&gt;
    local veh = getPedOccupiedVehicle ( me ) -- Get the player's vehicle&lt;br /&gt;
    &lt;br /&gt;
    if mass and veh then  -- If valid mass and in a vehicle&lt;br /&gt;
        local success = setVehicleHandling ( veh, &amp;quot;mass&amp;quot;, mass ) -- Set the vehicle's mass, and check if successful&lt;br /&gt;
        &lt;br /&gt;
        if success then -- If successful&lt;br /&gt;
            outputChatBox ( &amp;quot;Your vehicle's mass has been changed to: &amp;quot;..mass..&amp;quot; kg&amp;quot;, me, 0, 255, 0 ) -- Notify the player of success&lt;br /&gt;
        else -- Too bad failure is still an option&lt;br /&gt;
            outputChatBox ( &amp;quot;Setting mass failed. It's probably above or below allowed limits&amp;quot;, me, 255, 0, 0 ) -- Notify the player of failure, and give a possible reason&lt;br /&gt;
        end&lt;br /&gt;
    elseif not veh then -- If not in a vehicle&lt;br /&gt;
        outputChatBox ( &amp;quot;You're not in a vehicle&amp;quot;, me, 255, 0, 0 ) -- Tell the player; He / she obviously doesn't know&lt;br /&gt;
    elseif not mass then -- If not a valid mass&lt;br /&gt;
        outputChatBox ( &amp;quot;Syntax: /changemass [mass]&amp;quot;, me, 255, 0, 0 ) -- Tell the player the proper syntax&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;changemass&amp;quot;, massChange )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See other vehicle functions==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleHandling&amp;diff=25735</id>
		<title>GetVehicleHandling</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleHandling&amp;diff=25735"/>
		<updated>2011-05-07T10:29:33Z</updated>

		<summary type="html">&lt;p&gt;Snert: Made the example a bit nicer, fixed return values on failure, renamed it to getVehicleHandlingProperty to make the name more descriptive and made sure it should work (property &amp;lt;-&amp;gt; prop)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}} &lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function returns a table of the current vehicle handling data.&lt;br /&gt;
&lt;br /&gt;
''*'''Note:''' This function has not merged into the 1.1 nightly builds yet! It will only work if you have a custom build of the handling branch.''&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getVehicleHandling ( element theVehicle ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to get the handling data of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' containing all the handling data, ''false'' otherwise. Here a list of valid table properties and what they return:&lt;br /&gt;
{{Handling Properties}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server &amp;amp; Client&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example creates a new function called getVehicleHandlingProperty, which simulates the previous syntax of this function.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function getVehicleHandlingProperty ( element, property )&lt;br /&gt;
    if isElement ( element ) and getElementType ( element ) == &amp;quot;vehicle&amp;quot; and type ( property ) == &amp;quot;string&amp;quot; then -- Make sure there's a valid vehicle and a property string&lt;br /&gt;
        local handlingTable = getVehicleHandling ( element ) -- Get the handling as table and save as handlingTable&lt;br /&gt;
        local value = handlingTable[property] -- Get the value from the table&lt;br /&gt;
        &lt;br /&gt;
        if value then -- If there's a value (valid property)&lt;br /&gt;
            return value -- Return it&lt;br /&gt;
        else -- If the property is invalid&lt;br /&gt;
            return false -- Return failure&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return false -- Not an element, not a vehicle or no valid property string. Return failure&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See other vehicle functions==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RefreshResources&amp;diff=25498</id>
		<title>RefreshResources</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RefreshResources&amp;diff=25498"/>
		<updated>2011-03-17T09:56:52Z</updated>

		<summary type="html">&lt;p&gt;Snert: Added missing optional argument, for correctness' sake&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function finds new resources and checks for changes to the current ones.&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 refreshResources ( [ bool refreshAll = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''refreshAll''': If ''true'' MTA will check for changes in all resources. If ''false'', MTA will only check for new resources and try to reload resources with errors&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Checking for changes in all resources can result in lag for a short period of time. It should generally be avoided to set refreshAll to ''true''.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true is refresh was successful, 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 will refresh resources when a player uses the /refreshresources command just like the hardcoded /refreshall.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function commandRefreshResources(player)&lt;br /&gt;
    refreshResources(true)&lt;br /&gt;
    outputChatBox(&amp;quot;Resources refreshed&amp;quot;, player, 255, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;refreshresources&amp;quot;, commandRefreshResources)&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;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=25487</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=25487"/>
		<updated>2011-03-14T20:28:06Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
===Runcode++===&lt;br /&gt;
&lt;br /&gt;
Guess you should be able to guess it's related to runcode, but it's not a simple command. It's a GUI version of Runcode, with functions like:&lt;br /&gt;
&lt;br /&gt;
* Multi-line input&lt;br /&gt;
* Being able to save and load script files&lt;br /&gt;
* Being able to edit multiple script files at the same time&lt;br /&gt;
&lt;br /&gt;
Please note that this is an old resource of mine, and I'm just releasing it because it might be useful for development or someone might simply like the idea. I'm planning to continue on this if there's some sort of getFilesAtLocation to store script files client-side, without hassle.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/advruncode.zip Download] ('''Note:''' Work-in-progress, old and not extensively tested)&lt;br /&gt;
&lt;br /&gt;
==Other potentially useful stuff==&lt;br /&gt;
&lt;br /&gt;
===SA Weather table===&lt;br /&gt;
&lt;br /&gt;
I'm trying to make the timecyc.dat file a lot more readable, mostly for me to be able to make new functions. But I guess it might be useful to scripters as well, if they're for instance intending to use the weather functions to create their own weather system.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/SA%20Weather%20Table.xlsx Download] ('''Note:''' Work-in-progress)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getAllAccountData ( account theAccount )&lt;br /&gt;
bool setAllAccountData ( account theAccount, table theData )&lt;br /&gt;
&lt;br /&gt;
bool setVehicleAdjustableProperty ( element theVehicle, int value )&lt;br /&gt;
int getVehicleAdjustableProperty ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. There seems to be a function for this in the source&lt;br /&gt;
areStreetLightsEnabled ( )&lt;br /&gt;
areBackgroundGunshotsEnabled ( )&lt;br /&gt;
areBirdsEnabled ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater. Gotta find a way to set it for all peds, not just for the local player&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreate ( ) -- Triggered when an element was created&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreate ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
setRainLevel&lt;br /&gt;
setFogDistance&lt;br /&gt;
setSunColor&lt;br /&gt;
setSunSize&lt;br /&gt;
setFarClipDistance&lt;br /&gt;
setHeatHaze&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setLightningEnabled&lt;br /&gt;
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it&lt;br /&gt;
setSandStormEnabled&lt;br /&gt;
&lt;br /&gt;
-- Some more stuff that might be good to give scripters control of (all from timecyc.dat)&lt;br /&gt;
setAmbienceColor -- Sets the color (filter) of objects (or so I assume)&lt;br /&gt;
setDirectLightColor -- Sets the color (filter) of vehicles and peds&lt;br /&gt;
setSpriteBrightness&lt;br /&gt;
setShadowIntensity&lt;br /&gt;
setLightShadingValue&lt;br /&gt;
setLightOnGround&lt;br /&gt;
setLowerCloudColor -- NOTE: It is assumed that this is the clouds which sort of fly around low, the type of clouds which aren't disabled yet by setCloudsEnabled. Thus, important&lt;br /&gt;
setUpperCloudColor&lt;br /&gt;
setColorCorrection&lt;br /&gt;
&lt;br /&gt;
-- Prolly the heck of a lot more&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MTA proposals==&lt;br /&gt;
&lt;br /&gt;
===Getting contents of folders===&lt;br /&gt;
&lt;br /&gt;
The current system for files is fine, but it could be better. For instance, there's no way to know what files are in a folder, unless you specifically try to keep track of them. In most cases this is fine, but it could of course be very useful in some cases to be able to locate all files / folders inside a specific folder.&lt;br /&gt;
&lt;br /&gt;
====Proposed functions====&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Names pending&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getFilesAtLocation&lt;br /&gt;
getFoldersAtLocation&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Possible uses====&lt;br /&gt;
&lt;br /&gt;
* Radio scripts could easily allow players adding their own music, without having to edit a XML file or any manual setup&lt;br /&gt;
* Script editors could immediately detect all available scripts without having to inspect the meta.xml&lt;br /&gt;
* Scripts will be able to store things like replay files without having to keep track of them in an XML file&lt;br /&gt;
&lt;br /&gt;
====Obstacles====&lt;br /&gt;
&lt;br /&gt;
* It should be compatible with both Linux and Windows server-side. Client-side windows only isn't an issue, but on the server it is&lt;br /&gt;
* Filepaths were always intended to point towards individual files instead of folders. A workaround for this should be found, if there functions were to be added&lt;br /&gt;
* Possibly some other stuff&lt;br /&gt;
&lt;br /&gt;
====Basic hackpatch====&lt;br /&gt;
&lt;br /&gt;
I've attempted to make support for these functions a few days ago. I actually &amp;quot;succeeded&amp;quot; in it, client-side only, getFilesAtLocation only and very hackily implemented. But oh well, it'd give the general idea.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/getFilesAtLocation.patch Download]&lt;br /&gt;
&lt;br /&gt;
Example usage:&lt;br /&gt;
&lt;br /&gt;
  crun getFilesAtLocation(&amp;quot;:runcode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
What's wrong with just exporting the POSIX functions into MTA? Could even make them Lua iterators, so you could do for entry in directory(&amp;quot;:runcode&amp;quot;) do print(entry.name .. &amp;quot;, file? &amp;quot; .. entry.isFile) end --[[User:Alberto Alonso|Alberto Alonso]] 03:15, 21 December 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Serverlist independence===&lt;br /&gt;
&lt;br /&gt;
The server browser has always been an issue in MTA. People often complain about game-monitor being down or just being plain slow. Also, servers only show up on game-monitor after a long amount of uptime, or sometimes they don't show up at all. So, we'll need to change something. That's for sure.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' I didn't do a lot of reseach as to how it works currently&lt;br /&gt;
&lt;br /&gt;
====My proposal====&lt;br /&gt;
&lt;br /&gt;
In short: Support third-party server browsers&lt;br /&gt;
&lt;br /&gt;
In a bit more detail:&lt;br /&gt;
&lt;br /&gt;
* Servers will get new options in which they'll be able to make their own list of server browsers they want to appear on&lt;br /&gt;
* Clients will get a new GUI in which they'll be able to make their own list of server browsers to request the server lists from&lt;br /&gt;
* The server will update all server browsers in its list periodically (and at startup, of course)&lt;br /&gt;
* The client can now check out all server browsers, and merge all results into a list&lt;br /&gt;
&lt;br /&gt;
This should remove dependency on specific server browsers, and therefore it should make the server browser so much more useful. (Because of less downtime and probably fuller serverlists)&lt;br /&gt;
&lt;br /&gt;
====Problems to overcome====&lt;br /&gt;
&lt;br /&gt;
* The server should not wait for the server browser query to be completed&lt;br /&gt;
** Each server browser should get its own update thread, to ensure they won't block eachother either&lt;br /&gt;
* The merging of the server browsers at the client might be tricky. You'd have to know which entry is the most recent one, and use that, while not waiting until all browsers have finally returned their results&lt;br /&gt;
** Not sure how the server browser works currently, but in case the client queries the data directly from the MTA server, ignore this. If not, it would still be a good idea&lt;br /&gt;
* There should be multiple official server lists&lt;br /&gt;
* All server lists should use the same protocol&lt;br /&gt;
&lt;br /&gt;
====Other stuff====&lt;br /&gt;
&lt;br /&gt;
Servers should have a setting like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;serverlists&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.game-monitor.com&amp;quot;/&amp;gt; &amp;lt;!-- not sure bout the link itself, but it's the general idea --&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.mtasa.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.mtaserverlist.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/serverlists&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Client-side there should also be a GUI for this, with the possibility to name specific server browsers to make organising the list a lot easier. It should also list stuff like average ping, results and downtime, for convenience. Also, it would be useful to have another GUI which will fetch a list of server browsers from the internet, so people can quickly add new server browsers, or re-add official server browsers they previously removed.&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
Variables I've discovered through playing around with Cheat Engine&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables. Got these from Cheat Engine as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
! Assembly&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
| mov byte ptr [edi+008e4cd0],02&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
| mov byte ptr [ebp+10],03&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
| mov byte ptr [ebx+008e4cd0],01&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TODOcument==&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getRainLevel ( )&lt;br /&gt;
setRainLevel ( float rainLevel )&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
getFogDistance ( )&lt;br /&gt;
setFogDistance ( float distance )&lt;br /&gt;
resetFogDistance ( )&lt;br /&gt;
&lt;br /&gt;
getFarClipDistance ( )&lt;br /&gt;
setFarClipDistance ( float distance )&lt;br /&gt;
resetFarClipDistance ( )&lt;br /&gt;
&lt;br /&gt;
getSunColor ( )&lt;br /&gt;
setSunColor ( [ int coreR, int coreG, int coreB, int coronaR, int coronaG, int coronaB ] )&lt;br /&gt;
resetSunColor ( )&lt;br /&gt;
&lt;br /&gt;
getSunSize ( )&lt;br /&gt;
setSunSize ( float size )&lt;br /&gt;
resetSunSize ( )&lt;br /&gt;
&lt;br /&gt;
areInteriorSoundsEnabled ( )&lt;br /&gt;
setInteriorSoundsEnabled ( bool enabled )&lt;br /&gt;
&lt;br /&gt;
isElementFrozen ( element theElement ) -- Also mark the functions it replaced as &amp;quot;deprecated&amp;quot;&lt;br /&gt;
setElementFrozen ( element theElement, bool frozen ) -- Same here, of course&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Element map properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Vehicle:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Ped:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Object:&lt;br /&gt;
&lt;br /&gt;
- frozen     = bool frozen&lt;br /&gt;
- collisions = bool collisionsEnabled&lt;br /&gt;
- scale      = float objectScale&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element/Object&amp;diff=25486</id>
		<title>Element/Object</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element/Object&amp;diff=25486"/>
		<updated>2011-03-14T20:24:44Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
The object class represents static, 3-D models in the GTA world. Objects can only represent models created by the server, they cannot represent models that are part of the GTA's default landscape. Examples of objects include building models, roads, and terrain.&lt;br /&gt;
&lt;br /&gt;
The element type of this class is '''&amp;quot;object&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
==XML syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;object model=&amp;quot;&amp;quot; posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; rotX=&amp;quot;&amp;quot; rotY=&amp;quot;&amp;quot; rotZ=&amp;quot;&amp;quot; interior=&amp;quot;&amp;quot; dimension=&amp;quot;&amp;quot; scale=&amp;quot;&amp;quot; collisions=&amp;quot;&amp;quot; alpha=&amp;quot;&amp;quot; frozen=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Attributes===&lt;br /&gt;
* '''model''': The ID of the object being created. Since GTA has thousands of objects, these are hard to document on the wiki. Instead, they can be found using the object browser in the map editor.&lt;br /&gt;
* '''posX''': A float representing the X position of the object.&lt;br /&gt;
* '''posY''': A float representing the Y position of the object.&lt;br /&gt;
* '''posZ''': A float representing the Z position of the object.&lt;br /&gt;
&lt;br /&gt;
===Optional Attributes===&lt;br /&gt;
* '''rotX''': A float representing the X rotation of the object in degrees.&lt;br /&gt;
* '''rotY''': A float representing the Y rotation of the object in degrees.&lt;br /&gt;
* '''rotZ''': A float representing the Z rotation of the object in degrees.&lt;br /&gt;
* '''interior''': The interior world the object is in.&lt;br /&gt;
* '''dimension''': The object's dimension number.&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* '''scale''': The object's scale.&lt;br /&gt;
* '''collisions''': Enable/Disable object collisions.&lt;br /&gt;
* '''alpha''': Changes the object alpha.&lt;br /&gt;
* '''frozen''': Sets whether the object should be frozen (also known as static)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
{{Object functions}}&lt;br /&gt;
[[Category:Element Types]]&lt;br /&gt;
[[ru:Element/Object]]&lt;br /&gt;
[[it:Elemento/Oggetto]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element/Ped&amp;diff=25485</id>
		<title>Element/Ped</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element/Ped&amp;diff=25485"/>
		<updated>2011-03-14T20:22:06Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
The word &amp;quot;ped&amp;quot; is short for &amp;quot;pedestrian&amp;quot; and describes any person in GTA, be it a player or an NPC character. (And even though &amp;quot;pedestrian&amp;quot; doesn't technically apply to people that drive, they still fall under this name)&lt;br /&gt;
&lt;br /&gt;
The [[createPed]] function specifically creates an NPC, but all other ped functions work on both players and NPC's as they're pretty much the same thing to San Andreas.&lt;br /&gt;
&lt;br /&gt;
The element type of a NPC is '''&amp;quot;ped&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
==XML syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ped model=&amp;quot;&amp;quot; posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; rotZ=&amp;quot;&amp;quot; interior=&amp;quot;&amp;quot; frozen=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Attributes===&lt;br /&gt;
* '''model''': The [[Character_Skins|character skin ID]] of the ped being created.&lt;br /&gt;
* '''posX''': A float representing the X position of the ped.&lt;br /&gt;
* '''posY''': A float representing the Y position of the ped.&lt;br /&gt;
* '''posZ''': A float representing the Z position of the ped.&lt;br /&gt;
&lt;br /&gt;
===Optional Attributes===&lt;br /&gt;
* '''rotZ''': A float representing the Z rotation of the ped.&lt;br /&gt;
* '''interior''': A interior where the ped spawns.&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* '''frozen''': A bool indicating whether the ped should be capable of moving&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
{{Ped functions}}&lt;br /&gt;
[[Category:Element Types]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element/Ped&amp;diff=25484</id>
		<title>Element/Ped</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element/Ped&amp;diff=25484"/>
		<updated>2011-03-14T20:21:54Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
The word &amp;quot;ped&amp;quot; is short for &amp;quot;pedestrian&amp;quot; and describes any person in GTA, be it a player or an NPC character. (And even though &amp;quot;pedestrian&amp;quot; doesn't technically apply to people that drive, they still fall under this name)&lt;br /&gt;
&lt;br /&gt;
The [[createPed]] function specifically creates an NPC, but all other ped functions work on both players and NPC's as they're pretty much the same thing to San Andreas.&lt;br /&gt;
&lt;br /&gt;
The element type of a NPC is '''&amp;quot;ped&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
==XML syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ped model=&amp;quot;&amp;quot; posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; rotZ=&amp;quot;&amp;quot; interior=&amp;quot;&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Attributes===&lt;br /&gt;
* '''model''': The [[Character_Skins|character skin ID]] of the ped being created.&lt;br /&gt;
* '''posX''': A float representing the X position of the ped.&lt;br /&gt;
* '''posY''': A float representing the Y position of the ped.&lt;br /&gt;
* '''posZ''': A float representing the Z position of the ped.&lt;br /&gt;
&lt;br /&gt;
===Optional Attributes===&lt;br /&gt;
* '''rotZ''': A float representing the Z rotation of the ped.&lt;br /&gt;
* '''interior''': A interior where the ped spawns.&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* '''frozen''': A bool indicating whether the ped should be capable of moving&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
{{Ped functions}}&lt;br /&gt;
[[Category:Element Types]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Element/Vehicle&amp;diff=25483</id>
		<title>Element/Vehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Element/Vehicle&amp;diff=25483"/>
		<updated>2011-03-14T20:20:56Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
The vehicle class represents vehicles in the GTA world. Vehicles can be occupied and controlled by players.&lt;br /&gt;
&lt;br /&gt;
The element type of this class is '''&amp;quot;vehicle&amp;quot;'''.&lt;br /&gt;
&lt;br /&gt;
==XML syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;xml&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;vehicle model=&amp;quot;&amp;quot; posX=&amp;quot;&amp;quot; posY=&amp;quot;&amp;quot; posZ=&amp;quot;&amp;quot; rotX=&amp;quot;&amp;quot; rotY=&amp;quot;&amp;quot; rotZ=&amp;quot;&amp;quot; color=&amp;quot;&amp;quot; upgrades=&amp;quot;&amp;quot; paintjob=&amp;quot;&amp;quot; plate=&amp;quot;&amp;quot; turretX=&amp;quot;&amp;quot; turretY=&amp;quot;&amp;quot; health=&amp;quot;&amp;quot; sirens=&amp;quot;&amp;quot; landingGearDown=&amp;quot;&amp;quot; specialState=&amp;quot;&amp;quot; locked=&amp;quot;&amp;quot; interior=&amp;quot;&amp;quot; dimension=&amp;quot;&amp;quot; frozen=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Attributes===&lt;br /&gt;
* '''model''': The [[Vehicle IDs|vehicle ID]] of the vehicle being created.&lt;br /&gt;
* '''posX''': A float representing the X position of the vehicle.&lt;br /&gt;
* '''posY''': A float representing the Y position of the vehicle.&lt;br /&gt;
* '''posZ''': A float representing the Z position of the vehicle.&lt;br /&gt;
&lt;br /&gt;
===Optional Attributes===&lt;br /&gt;
* '''rotX''': A float representing the X rotation of the vehicle.&lt;br /&gt;
* '''rotY''': A float representing the Y rotation of the vehicle.&lt;br /&gt;
* '''rotZ''': A float representing the Z rotation of the vehicle.&lt;br /&gt;
* '''color''': An integer indicating the vehicle's [[Vehicle Colors|color(s)]] (seperated by commas).&lt;br /&gt;
* '''upgrades''': An integer representing the vehicle's mod upgrade(s) (seperated by commas), defined in San Andreas\data\maps\veh_mods\veh_mods.ide&lt;br /&gt;
* '''paintjob''': An integer indicating the vehicle's paint job (only works on certain vehicles).&lt;br /&gt;
* '''plate''': A set of up to 8 characters that will be shown on the vehicle's license plate.&lt;br /&gt;
* '''turretX''': the vehicle's turret's rotation around the Z axis, in radians. Relative to the vehicle's rotation, i.e. turretX=0 will always make the turret point in the same direction as the vehicle.&lt;br /&gt;
* '''turretY''': the vehicle's turret's rotation around the X axis, in radians. 0 means horizontal, positive values will make it point up and negative values point it down.&lt;br /&gt;
* '''health''': the vehicle's health. A value of 1000 means completely healthy, although higher values are allowed.&lt;br /&gt;
* '''sirens''': whether or not the vehicle's sirens are on (e.g. police cars and ambulances). Possible values are &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot;.&lt;br /&gt;
* '''landingGearDown''': whether or not the vehicle's landing gear is down (only applicable to planes). Possible values are &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot;.&lt;br /&gt;
* '''specialState''': the vehicle's adjustable property number.&lt;br /&gt;
* '''locked''': whether or not the vehicle's doors are locked. &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;.&lt;br /&gt;
* '''interior''': the interior number of the vehicle&lt;br /&gt;
* '''dimension''': the dimension number of the vehicle&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* '''frozen''': A bool indicating whether the vehicle should be capable of moving&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Related scripting functions==&lt;br /&gt;
{{Vehicle functions}}&lt;br /&gt;
[[Category:Element Types]]&lt;br /&gt;
&lt;br /&gt;
[[it:Elemento/Veicolo]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Element_functions&amp;diff=25482</id>
		<title>Template:Element functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Element_functions&amp;diff=25482"/>
		<updated>2011-03-14T20:18:02Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[clearElementVisibleTo]]&lt;br /&gt;
*[[cloneElement]]&lt;br /&gt;
*[[createElement]]&lt;br /&gt;
*[[destroyElement]]&lt;br /&gt;
*[[getAllElementData]]&lt;br /&gt;
*[[getAttachedElements]]&lt;br /&gt;
*[[getElementAlpha]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[getElementAttachedOffsets]]&lt;br /&gt;
* [[getElementCollisionsEnabled]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getElementAttachedTo]]&lt;br /&gt;
*[[getElementByID]]&lt;br /&gt;
*[[getElementByIndex]]&lt;br /&gt;
*[[getElementChild]]&lt;br /&gt;
*[[getElementChildren]]&lt;br /&gt;
*[[getElementChildrenCount]]&lt;br /&gt;
*[[getElementColShape]]&lt;br /&gt;
*[[getElementData]]&lt;br /&gt;
*[[getElementDimension]]&lt;br /&gt;
*[[getElementHealth]]&lt;br /&gt;
*[[getElementID]]&lt;br /&gt;
*[[getElementInterior]]&lt;br /&gt;
*[[getElementParent]]&lt;br /&gt;
*[[getElementPosition]]&lt;br /&gt;
{{New feature|3.0004|1.0.4|&lt;br /&gt;
*[[getElementRotation]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getElementsByType]]&lt;br /&gt;
*[[getElementsWithinColShape]]&lt;br /&gt;
*[[getElementType]]&lt;br /&gt;
*[[getElementVelocity]]&lt;br /&gt;
*[[getElementZoneName]]&lt;br /&gt;
*[[getRootElement]]&lt;br /&gt;
*[[isElement]]&lt;br /&gt;
*[[isElementAttached]]&lt;br /&gt;
{{New feature|3.0004|1.0.4|&lt;br /&gt;
*[[isElementDoubleSided]]&lt;br /&gt;
}}&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
*[[isElementFrozen]]&lt;br /&gt;
}}&lt;br /&gt;
*[[isElementVisibleTo]]&lt;br /&gt;
*[[isElementWithinColShape]]&lt;br /&gt;
*[[removeElementData]]&lt;br /&gt;
*[[setElementAlpha]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
*[[setElementCollisionsEnabled]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setElementData]]&lt;br /&gt;
{{New feature|3.0004|1.0.4|&lt;br /&gt;
*[[setElementDoubleSided]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setElementDimension]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
*[[setElementFrozen]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setElementHealth]]&lt;br /&gt;
*[[setElementID]]&lt;br /&gt;
*[[setElementInterior]]&lt;br /&gt;
*[[setElementParent]]&lt;br /&gt;
*[[setElementPosition]]&lt;br /&gt;
{{New feature|3.0004|1.0.4|&lt;br /&gt;
*[[setElementSyncer]]&lt;br /&gt;
*[[setElementRotation]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setElementVelocity]]&lt;br /&gt;
*[[setElementVisibleTo]]&lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*[[attachElements]]&lt;br /&gt;
*[[detachElements]]&lt;br /&gt;
*[[getElementModel]]&lt;br /&gt;
*[[getElementSyncer]]&lt;br /&gt;
*[[isElementInWater]]&lt;br /&gt;
*[[setElementAttachedOffsets]]&lt;br /&gt;
*[[setElementModel]]&lt;br /&gt;
}}&lt;br /&gt;
{{Deprecated_feature|3|1.0|&lt;br /&gt;
*[[attachElementToElement]]&lt;br /&gt;
*[[detachElementFromElement]]&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsMTAWindowActive&amp;diff=25288</id>
		<title>IsMTAWindowActive</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsMTAWindowActive&amp;diff=25288"/>
		<updated>2011-01-31T10:20:29Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function returns whether any system windows that take focus are active. This includes:&lt;br /&gt;
* Chatbox input&lt;br /&gt;
* Console window&lt;br /&gt;
* Main menu&lt;br /&gt;
* Transferbox&lt;br /&gt;
To get the status of the debug view, see [[isDebugViewActive]].&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 isMTAWindowActive ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the focus is on the MTA window, ''false'' if it isn't.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This piece of script will kill a player if he has any of the above system windows open&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function dontAllowAnyOpenWindow ()&lt;br /&gt;
	if isMTAWindowActive ()	then&lt;br /&gt;
		 setElementHealth ( getLocalPlayer(), 0.0 )&lt;br /&gt;
	end	 &lt;br /&gt;
end&lt;br /&gt;
setTimer ( dontAllowAnyOpenWindow, 50, 0 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=FormatDate&amp;diff=25283</id>
		<title>FormatDate</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=FormatDate&amp;diff=25283"/>
		<updated>2011-01-29T11:44:25Z</updated>

		<summary type="html">&lt;p&gt;Snert: Undo revision 25282 by XiP3rfectx ~: Perhaps you should first take a look if the function isn't already broken before breaking it&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function formats a date according to the given format string.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;string FormatDate( string format, [ string escaper = &amp;quot;'&amp;quot;, int timestamp = GetTimestamp() ] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
* '''format''': Format string that determines how the date should be formatted. It provides the following wildcards:&lt;br /&gt;
** d: day (01-31)&lt;br /&gt;
** h: hour (00-23)&lt;br /&gt;
** i: minute (00-59)&lt;br /&gt;
** m: month (01-12)&lt;br /&gt;
** s: second (00-59)&lt;br /&gt;
** w: shortened day of the week (Su-Mo)&lt;br /&gt;
** W: day of the week (Sunday-Monday)&lt;br /&gt;
** y: shortened year (e.g. 09)&lt;br /&gt;
** Y: year (e.g. 2009)&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
* '''escaper''': Escape character that determines the beginning or end of a non-format-area, where the wildcards aren't replaced with their corresponding value. Note that the escapers get lost.&lt;br /&gt;
* '''timestamp''': Timestamp of the date that should be formatted.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a string containing the formatted date.&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
{{RequiredFunctions|Check}}&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server- and/or clientside Script&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local gWeekDays = { &amp;quot;Sunday&amp;quot;, &amp;quot;Monday&amp;quot;, &amp;quot;Tuesday&amp;quot;, &amp;quot;Wednesday&amp;quot;, &amp;quot;Thursday&amp;quot;, &amp;quot;Friday&amp;quot;, &amp;quot;Saturday&amp;quot; }&lt;br /&gt;
function FormatDate(format, escaper, timestamp)&lt;br /&gt;
	Check(&amp;quot;FormatDate&amp;quot;, &amp;quot;string&amp;quot;, format, &amp;quot;format&amp;quot;, {&amp;quot;nil&amp;quot;,&amp;quot;string&amp;quot;}, escaper, &amp;quot;escaper&amp;quot;, {&amp;quot;nil&amp;quot;,&amp;quot;string&amp;quot;}, timestamp, &amp;quot;timestamp&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	escaper = (escaper or &amp;quot;'&amp;quot;):sub(1, 1)&lt;br /&gt;
	local time = getRealTime(timestamp)&lt;br /&gt;
	local formattedDate = &amp;quot;&amp;quot;&lt;br /&gt;
	local escaped = false&lt;br /&gt;
&lt;br /&gt;
	time.year = time.year + 1900&lt;br /&gt;
	time.month = time.month + 1&lt;br /&gt;
	&lt;br /&gt;
	local datetime = { d = (&amp;quot;%02d&amp;quot;):format(time.monthday), h = (&amp;quot;%02d&amp;quot;):format(time.hour), i = (&amp;quot;%02d&amp;quot;):format(time.minute), m = (&amp;quot;%02d&amp;quot;):format(time.month), s = (&amp;quot;%02d&amp;quot;):format(time.second), w = gWeekDays[time.weekday+1]:sub(1, 2), W = gWeekDays[time.weekday+1], y = tostring(time.year):sub(-2), Y = time.year }&lt;br /&gt;
	&lt;br /&gt;
	for char in format:gmatch(&amp;quot;.&amp;quot;) do&lt;br /&gt;
		if (char == escaper) then escaped = not escaped&lt;br /&gt;
		else formattedDate = formattedDate..(not escaped and datetime[char] or char) end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return formattedDate&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs the actual date to a joining player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- get the root element&lt;br /&gt;
local _root = getRootElement()&lt;br /&gt;
-- define the onPlayerJoin handler function&lt;br /&gt;
function OnPlayerJoin()&lt;br /&gt;
    -- output the formatted date&lt;br /&gt;
    outputChatBox(FormatDate(&amp;quot;'You joined our server on' m/d/Y at h:m.&amp;quot;))&lt;br /&gt;
end&lt;br /&gt;
-- add the event handler&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerJoin&amp;quot;, _root, OnPlayerJoin)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Author: NeonBlack&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:OnClientDebugMessage&amp;diff=25027</id>
		<title>Talk:OnClientDebugMessage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:OnClientDebugMessage&amp;diff=25027"/>
		<updated>2011-01-09T13:15:56Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Do we really have a server-side event called onClient...? [[User:EAi|eAi]] 11:38, 9 January 2011 (UTC)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;amp;nbsp;&amp;amp;nbsp;&amp;amp;nbsp;Woops, fixed.--[[User:Snert|Snert]] 13:15, 9 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientDebugMessage&amp;diff=25026</id>
		<title>OnClientDebugMessage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientDebugMessage&amp;diff=25026"/>
		<updated>2011-01-09T13:14:37Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client event}}&lt;br /&gt;
This event is triggered when client-side debug messages (for instance errors or warnings) would appear in the debug window. This event doesn't require the debug window to be enabled to trigger, however.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string message, int level, string file, int line&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''message''': The message which was outputted in the server console, without details like file, line etc&lt;br /&gt;
*'''level''': The type of debug message which was outputted&lt;br /&gt;
**'''0:''' &amp;quot;Custom&amp;quot; message&lt;br /&gt;
**'''1:''' Error message&lt;br /&gt;
**'''2:''' Warning message&lt;br /&gt;
**'''3:''' Information message&lt;br /&gt;
*'''file''': The file from which the debug message was outputted&lt;br /&gt;
**'''Note:''' May return [[nil]] when the source could not be found&lt;br /&gt;
*'''line''': The line in file '''file''' where the debug message was outputted&lt;br /&gt;
**'''Note:''' May return [[nil]] when the source could not be found&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[root element]].&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This (easy) example outputs the debug message in the console, so you don't need to open debugscript 3 :D&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler (&amp;quot;onClientDebugMessage&amp;quot;,getRootElement(),&lt;br /&gt;
function(message,level,file,line)&lt;br /&gt;
  outputConsole (message,getLocalPlayer())&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Other client events===&lt;br /&gt;
{{Client_other_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Talk:GetPlayerIndex&amp;diff=25004</id>
		<title>Talk:GetPlayerIndex</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Talk:GetPlayerIndex&amp;diff=25004"/>
		<updated>2011-01-08T22:09:10Z</updated>

		<summary type="html">&lt;p&gt;Snert: Created page with &amp;quot;To be honest, I can't see a single reason why this could even be remotely useful. In your example, it's much easier to use the player element itself instead of a different index....&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To be honest, I can't see a single reason why this could even be remotely useful. In your example, it's much easier to use the player element itself instead of a different index. Also, if a player who joined in front of you would exit, you would get a different index. And that would in turn destroy the example as well. --[[User:Snert|Snert]] 22:09, 8 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Proposal:Sync_worlds&amp;diff=24825</id>
		<title>Proposal:Sync worlds</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Proposal:Sync_worlds&amp;diff=24825"/>
		<updated>2010-12-27T21:47:46Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Currently we sync pretty much everything to everyone. We do reduce the quality of the sync somewhat for distant players, but often this isn't relevant.&lt;br /&gt;
&lt;br /&gt;
Here's a proposed solution someone might like to implement to greatly reduce the bandwidth and CPU usage of servers and clients, when servers are configured to support it.&lt;br /&gt;
&lt;br /&gt;
==Solution==&lt;br /&gt;
* Add the concept of 'sync worlds' (need a better name). &lt;br /&gt;
* These can work alongside dimensions. &lt;br /&gt;
* Each dimension is in exactly one sync world (there's one by default that all dimensions are in). &lt;br /&gt;
* Players in a sync world receive updates from all the elements that change in that sync world. &lt;br /&gt;
* Elements not in the sync world the player is in aren't synced. &lt;br /&gt;
* When a player switches between two sync worlds, all the elements that have been modified since they were last in that sync world are sent to that client.&lt;br /&gt;
* During the 'resync', a loading screen or indicator is shown. &lt;br /&gt;
* The default behaviour would not use this new feature.&lt;br /&gt;
&lt;br /&gt;
==Technically==&lt;br /&gt;
* Add a list that stores 'sync world id' and a timestamp to the player class. This stores the last time a player was sent information about an element in that particular sync world.&lt;br /&gt;
* Add a timestamp to each element that stores the last time that element was updated&lt;br /&gt;
* When we modify an element, update the timestamp&lt;br /&gt;
* Need to consider the variety of ways that elements are synced - keysync, packets, RPC etc.&lt;br /&gt;
* Add a function, e.g. 'setDimensionSyncWorld' to specify the sync world a dimension belongs in.&lt;br /&gt;
* Need to bear in mind that the relevant client-side events should be triggered&lt;br /&gt;
* Need to consider elements that are deleted? Maybe keep a per-sync world list of deleted element ids along with timestamps. Or just delete them on every client? Or something else.&lt;br /&gt;
&lt;br /&gt;
[[Category:Proposal]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Category:Proposal&amp;diff=24824</id>
		<title>Category:Proposal</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Category:Proposal&amp;diff=24824"/>
		<updated>2010-12-27T21:46:40Z</updated>

		<summary type="html">&lt;p&gt;Snert: Created page with &amp;quot;These are proposals for changes to be made to MTA.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are proposals for changes to be made to MTA.&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24788</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24788"/>
		<updated>2010-12-20T19:51:34Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
===Runcode++===&lt;br /&gt;
&lt;br /&gt;
Guess you should be able to guess it's related to runcode, but it's not a simple command. It's a GUI version of Runcode, with functions like:&lt;br /&gt;
&lt;br /&gt;
* Multi-line input&lt;br /&gt;
* Being able to save and load script files&lt;br /&gt;
* Being able to edit multiple script files at the same time&lt;br /&gt;
&lt;br /&gt;
Please note that this is an old resource of mine, and I'm just releasing it because it might be useful for development or someone might simply like the idea. I'm planning to continue on this if there's some sort of getFilesAtLocation to store script files client-side, without hassle.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/advruncode.zip Download] ('''Note:''' Work-in-progress, old and not extensively tested)&lt;br /&gt;
&lt;br /&gt;
==Other potentially useful stuff==&lt;br /&gt;
&lt;br /&gt;
===SA Weather table===&lt;br /&gt;
&lt;br /&gt;
I'm trying to make the timecyc.dat file a lot more readable, mostly for me to be able to make new functions. But I guess it might be useful to scripters as well, if they're for instance intending to use the weather functions to create their own weather system.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/SA%20Weather%20Table.xlsx Download] ('''Note:''' Work-in-progress)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getAllAccountData ( account theAccount )&lt;br /&gt;
bool setAllAccountData ( account theAccount, table theData )&lt;br /&gt;
&lt;br /&gt;
bool setVehicleAdjustableProperty ( element theVehicle, int value )&lt;br /&gt;
int getVehicleAdjustableProperty ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. There seems to be a function for this in the source&lt;br /&gt;
areStreetLightsEnabled ( )&lt;br /&gt;
areBackgroundGunshotsEnabled ( )&lt;br /&gt;
areBirdsEnabled ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater. Gotta find a way to set it for all peds, not just for the local player&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreate ( ) -- Triggered when an element was created&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreate ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
setRainLevel&lt;br /&gt;
setFogDistance&lt;br /&gt;
setSunColor&lt;br /&gt;
setSunSize&lt;br /&gt;
setFarClipDistance&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setLightningEnabled&lt;br /&gt;
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it&lt;br /&gt;
setSandStormEnabled&lt;br /&gt;
&lt;br /&gt;
-- Some more stuff that might be good to give scripters control of (all from timecyc.dat)&lt;br /&gt;
setAmbienceColor -- Sets the color (filter) of objects (or so I assume)&lt;br /&gt;
setDirectLightColor -- Sets the color (filter) of vehicles and peds&lt;br /&gt;
setSpriteBrightness&lt;br /&gt;
setShadowIntensity&lt;br /&gt;
setLightShadingValue&lt;br /&gt;
setLightOnGround&lt;br /&gt;
setLowerCloudColor -- NOTE: It is assumed that this is the clouds which sort of fly around low, the type of clouds which aren't disabled yet by setCloudsEnabled. Thus, important&lt;br /&gt;
setUpperCloudColor&lt;br /&gt;
setColorCorrection&lt;br /&gt;
&lt;br /&gt;
-- Prolly the heck of a lot more&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MTA proposals==&lt;br /&gt;
&lt;br /&gt;
===Getting contents of folders===&lt;br /&gt;
&lt;br /&gt;
The current system for files is fine, but it could be better. For instance, there's no way to know what files are in a folder, unless you specifically try to keep track of them. In most cases this is fine, but it could of course be very useful in some cases to be able to locate all files / folders inside a specific folder.&lt;br /&gt;
&lt;br /&gt;
====Proposed functions====&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Names pending&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getFilesAtLocation&lt;br /&gt;
getFoldersAtLocation&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Possible uses====&lt;br /&gt;
&lt;br /&gt;
* Radio scripts could easily allow players adding their own music, without having to edit a XML file or any manual setup&lt;br /&gt;
* Script editors could immediately detect all available scripts without having to inspect the meta.xml&lt;br /&gt;
* Scripts will be able to store things like replay files without having to keep track of them in an XML file&lt;br /&gt;
&lt;br /&gt;
====Obstacles====&lt;br /&gt;
&lt;br /&gt;
* It should be compatible with both Linux and Windows server-side. Client-side windows only isn't an issue, but on the server it is&lt;br /&gt;
* Filepaths were always intended to point towards individual files instead of folders. A workaround for this should be found, if there functions were to be added&lt;br /&gt;
* Possibly some other stuff&lt;br /&gt;
&lt;br /&gt;
====Basic hackpatch====&lt;br /&gt;
&lt;br /&gt;
I've attempted to make support for these functions a few days ago. I actually &amp;quot;succeeded&amp;quot; in it, client-side only, getFilesAtLocation only and very hackily implemented. But oh well, it'd give the general idea.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/getFilesAtLocation.patch Download]&lt;br /&gt;
&lt;br /&gt;
Example usage:&lt;br /&gt;
&lt;br /&gt;
  crun getFilesAtLocation(&amp;quot;:runcode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Serverlist independence===&lt;br /&gt;
&lt;br /&gt;
The server browser has always been an issue in MTA. People often complain about game-monitor being down or just being plain slow. Also, servers only show up on game-monitor after a long amount of uptime, or sometimes they don't show up at all. So, we'll need to change something. That's for sure.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' I didn't do a lot of reseach as to how it works currently&lt;br /&gt;
&lt;br /&gt;
====My proposal====&lt;br /&gt;
&lt;br /&gt;
In short: Support third-party server browsers&lt;br /&gt;
&lt;br /&gt;
In a bit more detail:&lt;br /&gt;
&lt;br /&gt;
* Servers will get new options in which they'll be able to make their own list of server browsers they want to appear on&lt;br /&gt;
* Clients will get a new GUI in which they'll be able to make their own list of server browsers to request the server lists from&lt;br /&gt;
* The server will update all server browsers in its list periodically (and at startup, of course)&lt;br /&gt;
* The client can now check out all server browsers, and merge all results into a list&lt;br /&gt;
&lt;br /&gt;
This should remove dependency on specific server browsers, and therefore it should make the server browser so much more useful. (Because of less downtime and probably fuller serverlists)&lt;br /&gt;
&lt;br /&gt;
====Problems to overcome====&lt;br /&gt;
&lt;br /&gt;
* The server should not wait for the server browser query to be completed&lt;br /&gt;
** Each server browser should get its own update thread, to ensure they won't block eachother either&lt;br /&gt;
* The merging of the server browsers at the client might be tricky. You'd have to know which entry is the most recent one, and use that, while not waiting until all browsers have finally returned their results&lt;br /&gt;
** Not sure how the server browser works currently, but in case the client queries the data directly from the MTA server, ignore this. If not, it would still be a good idea&lt;br /&gt;
* There should be multiple official server lists&lt;br /&gt;
* All server lists should use the same protocol&lt;br /&gt;
&lt;br /&gt;
====Other stuff====&lt;br /&gt;
&lt;br /&gt;
Servers should have a setting like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;serverlists&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.game-monitor.com&amp;quot;/&amp;gt; &amp;lt;!-- not sure bout the link itself, but it's the general idea --&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.mtasa.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.mtaserverlist.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/serverlists&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Client-side there should also be a GUI for this, with the possibility to name specific server browsers to make organising the list a lot easier. It should also list stuff like average ping, results and downtime, for convenience. Also, it would be useful to have another GUI which will fetch a list of server browsers from the internet, so people can quickly add new server browsers, or re-add official server browsers they previously removed.&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
Variables I've discovered through playing around with Cheat Engine&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables. Got these from Cheat Engine as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
! Assembly&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
| mov byte ptr [edi+008e4cd0],02&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
| mov byte ptr [ebp+10],03&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
| mov byte ptr [ebx+008e4cd0],01&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TODOcument==&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getRainLevel ( )&lt;br /&gt;
setRainLevel ( float rainLevel )&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
getFogDistance ( )&lt;br /&gt;
setFogDistance ( float distance )&lt;br /&gt;
resetFogDistance ( )&lt;br /&gt;
&lt;br /&gt;
getFarClipDistance ( )&lt;br /&gt;
setFarClipDistance ( float distance )&lt;br /&gt;
resetFarClipDistance ( )&lt;br /&gt;
&lt;br /&gt;
getSunColor ( )&lt;br /&gt;
setSunColor ( [ int coreR, int coreG, int coreB, int coronaR, int coronaG, int coronaB ] )&lt;br /&gt;
resetSunColor ( )&lt;br /&gt;
&lt;br /&gt;
getSunSize ( )&lt;br /&gt;
setSunSize ( float size )&lt;br /&gt;
resetSunSize ( )&lt;br /&gt;
&lt;br /&gt;
areInteriorSoundsEnabled ( )&lt;br /&gt;
setInteriorSoundsEnabled ( bool enabled )&lt;br /&gt;
&lt;br /&gt;
isElementFrozen ( element theElement ) -- Also mark the functions it replaced as &amp;quot;deprecated&amp;quot;&lt;br /&gt;
setElementFrozen ( element theElement, bool frozen ) -- Same here, of course&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Element map properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Vehicle:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Ped:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Object:&lt;br /&gt;
&lt;br /&gt;
- frozen     = bool frozen&lt;br /&gt;
- collisions = bool collisionsEnabled&lt;br /&gt;
- scale      = float objectScale&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetRealTime&amp;diff=24784</id>
		<title>GetRealTime</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetRealTime&amp;diff=24784"/>
		<updated>2010-12-20T13:35:27Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function gets the real server time and returns it in a table. If you want to get the in-game time (shown on GTA's clock) use [[getTime]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getRealTime( [int seconds = current] )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''table'' of substrings with different time format, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;2&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid; border-collapse: collapse; font-size: 95%;&amp;quot;&lt;br /&gt;
|'''Member'''&lt;br /&gt;
|'''Meaning'''&lt;br /&gt;
|'''Range'''&lt;br /&gt;
|-&lt;br /&gt;
|second&lt;br /&gt;
|seconds after the minute&lt;br /&gt;
|0-61*&lt;br /&gt;
|-&lt;br /&gt;
|minute&lt;br /&gt;
|minutes after the hour&lt;br /&gt;
|0-59&lt;br /&gt;
|-&lt;br /&gt;
|hour&lt;br /&gt;
|hours since midnight&lt;br /&gt;
|0-23&lt;br /&gt;
|-&lt;br /&gt;
|monthday&lt;br /&gt;
|day of the month&lt;br /&gt;
|1-31&lt;br /&gt;
|-&lt;br /&gt;
|month&lt;br /&gt;
|months since January&lt;br /&gt;
|0-11&lt;br /&gt;
|-&lt;br /&gt;
|year&lt;br /&gt;
|years since 1900&lt;br /&gt;
|-&lt;br /&gt;
|weekday&lt;br /&gt;
|days since Sunday&lt;br /&gt;
|0-6&lt;br /&gt;
|-&lt;br /&gt;
|yearday&lt;br /&gt;
|days since January 1&lt;br /&gt;
|0-365&lt;br /&gt;
|-&lt;br /&gt;
|isdst&lt;br /&gt;
|Daylight Saving Time flag&lt;br /&gt;
|-&lt;br /&gt;
|timestamp&lt;br /&gt;
|seconds since 1970 (MTA 1.1 +)&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
* tm_sec is generally 0-59. Extra range to accommodate for leap seconds in certain systems.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
{{New feature|3|1.0|&lt;br /&gt;
*'''seconds:''' A count in seconds from the year 1970.  Useful for storing points in time, or for retrieving time information for [[getBanTime]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs local time (server or client, where ever it was triggered) as hours and minutes&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showtime ()&lt;br /&gt;
	local time = getRealTime()&lt;br /&gt;
	local hours = time.hour&lt;br /&gt;
	local minutes = time.minute&lt;br /&gt;
	outputChatBox ( &amp;quot;Local Time: &amp;quot;..hours..&amp;quot;:&amp;quot;..minutes )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Utility functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24783</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24783"/>
		<updated>2010-12-19T23:22:56Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
===Runcode++===&lt;br /&gt;
&lt;br /&gt;
Guess you should be able to guess it's related to runcode, but it's not a simple command. It's a GUI version of Runcode, with functions like:&lt;br /&gt;
&lt;br /&gt;
* Multi-line input&lt;br /&gt;
* Being able to save and load script files&lt;br /&gt;
* Being able to edit multiple script files at the same time&lt;br /&gt;
&lt;br /&gt;
Please note that this is an old resource of mine, and I'm just releasing it because it might be useful for development or someone might simply like the idea. I'm planning to continue on this if there's some sort of getFilesAtLocation to store script files client-side, without hassle.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/advruncode.zip Download] ('''Note:''' Work-in-progress, old and not extensively tested)&lt;br /&gt;
&lt;br /&gt;
==Other potentially useful stuff==&lt;br /&gt;
&lt;br /&gt;
===SA Weather table===&lt;br /&gt;
&lt;br /&gt;
I'm trying to make the timecyc.dat file a lot more readable, mostly for me to be able to make new functions. But I guess it might be useful to scripters as well, if they're for instance intending to use the weather functions to create their own weather system.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/SA%20Weather%20Table.xlsx Download] ('''Note:''' Work-in-progress)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getAllAccountData ( account theAccount )&lt;br /&gt;
bool setAllAccountData ( account theAccount, table theData )&lt;br /&gt;
&lt;br /&gt;
bool setVehicleAdjustableProperty ( element theVehicle, int value )&lt;br /&gt;
int getVehicleAdjustableProperty ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. There seems to be a function for this in the source&lt;br /&gt;
areStreetLightsEnabled ( )&lt;br /&gt;
areBackgroundGunshotsEnabled ( )&lt;br /&gt;
areBirdsEnabled ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater. Gotta find a way to set it for all peds, not just for the local player&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreate ( ) -- Triggered when an element was created&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreate ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
setRainLevel&lt;br /&gt;
setFogDistance -- TODO: Rename to setFarClipDistance; timecyc.dat is such a great mess I only noticed this was wrong when I tried to reorganize the darn file&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setLightningEnabled&lt;br /&gt;
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it&lt;br /&gt;
setSandStormEnabled&lt;br /&gt;
&lt;br /&gt;
-- Some more stuff that might be good to give scripters control of (all from timecyc.dat)&lt;br /&gt;
setAmbienceColor -- Sets the color (filter) of objects (or so I assume)&lt;br /&gt;
setDirectLightColor -- Sets the color (filter) of vehicles and peds&lt;br /&gt;
setSunColor&lt;br /&gt;
setSunSize&lt;br /&gt;
setSpriteBrightness&lt;br /&gt;
setShadowIntensity&lt;br /&gt;
setLightShadingValue&lt;br /&gt;
setFarClipDistance -- NOTE: Rename setFogDistance to this, as it's more correct (and appears this way in timecyc.dat)&lt;br /&gt;
setFogStartDistance&lt;br /&gt;
setLightOnGround&lt;br /&gt;
setLowerCloudColor -- NOTE: It is assumed that this is the clouds which sort of fly around low, the type of clouds which aren't disabled yet by setCloudsEnabled. Thus, important&lt;br /&gt;
setUpperCloudColor&lt;br /&gt;
setColorCorrection&lt;br /&gt;
&lt;br /&gt;
-- Prolly the heck of a lot more&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==MTA proposals==&lt;br /&gt;
&lt;br /&gt;
===Getting contents of folders===&lt;br /&gt;
&lt;br /&gt;
The current system for files is fine, but it could be better. For instance, there's no way to know what files are in a folder, unless you specifically try to keep track of them. In most cases this is fine, but it could of course be very useful in some cases to be able to locate all files / folders inside a specific folder.&lt;br /&gt;
&lt;br /&gt;
====Proposed functions====&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Names pending&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getFilesAtLocation&lt;br /&gt;
getFoldersAtLocation&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Possible uses====&lt;br /&gt;
&lt;br /&gt;
* Radio scripts could easily allow players adding their own music, without having to edit a XML file or any manual setup&lt;br /&gt;
* Script editors could immediately detect all available scripts without having to inspect the meta.xml&lt;br /&gt;
* Scripts will be able to store things like replay files without having to keep track of them in an XML file&lt;br /&gt;
&lt;br /&gt;
====Obstacles====&lt;br /&gt;
&lt;br /&gt;
* It should be compatible with both Linux and Windows server-side. Client-side windows only isn't an issue, but on the server it is&lt;br /&gt;
* Filepaths were always intended to point towards individual files instead of folders. A workaround for this should be found, if there functions were to be added&lt;br /&gt;
* Possibly some other stuff&lt;br /&gt;
&lt;br /&gt;
====Basic hackpatch====&lt;br /&gt;
&lt;br /&gt;
I've attempted to make support for these functions a few days ago. I actually &amp;quot;succeeded&amp;quot; in it, client-side only, getFilesAtLocation only and very hackily implemented. But oh well, it'd give the general idea.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/getFilesAtLocation.patch Download]&lt;br /&gt;
&lt;br /&gt;
Example usage:&lt;br /&gt;
&lt;br /&gt;
  crun getFilesAtLocation(&amp;quot;:runcode&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Serverlist independence===&lt;br /&gt;
&lt;br /&gt;
The server browser has always been an issue in MTA. People often complain about game-monitor being down or just being plain slow. Also, servers only show up on game-monitor after a long amount of uptime, or sometimes they don't show up at all. So, we'll need to change something. That's for sure.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' I didn't do a lot of reseach as to how it works currently&lt;br /&gt;
&lt;br /&gt;
====My proposal====&lt;br /&gt;
&lt;br /&gt;
In short: Support third-party server browsers&lt;br /&gt;
&lt;br /&gt;
In a bit more detail:&lt;br /&gt;
&lt;br /&gt;
* Servers will get new options in which they'll be able to make their own list of server browsers they want to appear on&lt;br /&gt;
* Clients will get a new GUI in which they'll be able to make their own list of server browsers to request the server lists from&lt;br /&gt;
* The server will update all server browsers in its list periodically (and at startup, of course)&lt;br /&gt;
* The client can now check out all server browsers, and merge all results into a list&lt;br /&gt;
&lt;br /&gt;
This should remove dependency on specific server browsers, and therefore it should make the server browser so much more useful. (Because of less downtime and probably fuller serverlists)&lt;br /&gt;
&lt;br /&gt;
====Problems to overcome====&lt;br /&gt;
&lt;br /&gt;
* The server should not wait for the server browser query to be completed&lt;br /&gt;
** Each server browser should get its own update thread, to ensure they won't block eachother either&lt;br /&gt;
* The merging of the server browsers at the client might be tricky. You'd have to know which entry is the most recent one, and use that, while not waiting until all browsers have finally returned their results&lt;br /&gt;
** Not sure how the server browser works currently, but in case the client queries the data directly from the MTA server, ignore this. If not, it would still be a good idea&lt;br /&gt;
* There should be multiple official server lists&lt;br /&gt;
* All server lists should use the same protocol&lt;br /&gt;
&lt;br /&gt;
====Other stuff====&lt;br /&gt;
&lt;br /&gt;
Servers should have a setting like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;serverlists&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.game-monitor.com&amp;quot;/&amp;gt; &amp;lt;!-- not sure bout the link itself, but it's the general idea --&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.mtasa.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;serverlist location=&amp;quot;www.mtaserverlist.com&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;...&amp;gt;&lt;br /&gt;
&amp;lt;/serverlists&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Client-side there should also be a GUI for this, with the possibility to name specific server browsers to make organising the list a lot easier. It should also list stuff like average ping, results and downtime, for convenience. Also, it would be useful to have another GUI which will fetch a list of server browsers from the internet, so people can quickly add new server browsers, or re-add official server browsers they previously removed.&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
Variables I've discovered through playing around with Cheat Engine&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables. Got these from Cheat Engine as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
! Assembly&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
| mov byte ptr [edi+008e4cd0],02&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
| mov byte ptr [ebp+10],03&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
| mov byte ptr [ebx+008e4cd0],01&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TODOcument==&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getRainLevel ( )&lt;br /&gt;
setRainLevel ( float rainLevel )&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
getFogDistance ( )&lt;br /&gt;
setFogDistance ( float distance )&lt;br /&gt;
resetFogDistance ( )&lt;br /&gt;
&lt;br /&gt;
areInteriorSoundsEnabled ( )&lt;br /&gt;
setInteriorSoundsEnabled ( bool enabled )&lt;br /&gt;
&lt;br /&gt;
isElementFrozen ( element theElement ) -- Also mark the functions it replaced as &amp;quot;deprecated&amp;quot;&lt;br /&gt;
setElementFrozen ( element theElement, bool frozen ) -- Same here, of course&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Element map properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Vehicle:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Ped:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Object:&lt;br /&gt;
&lt;br /&gt;
- frozen     = bool frozen&lt;br /&gt;
- collisions = bool collisionsEnabled&lt;br /&gt;
- scale      = float objectScale&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24685</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24685"/>
		<updated>2010-12-10T09:59:33Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Other potentially useful stuff==&lt;br /&gt;
&lt;br /&gt;
===SA Weather table===&lt;br /&gt;
&lt;br /&gt;
I'm trying to make the timecyc.dat file a lot more readable, mostly for me to be able to make new functions. But I guess it might be useful to scripters as well, if they're for instance intending to use the weather functions to create their own weather system.&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/SA%20Weather%20Table.xlsx Download] ('''Note:''' Work-in-progress)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
table getAllAccountData ( account theAccount )&lt;br /&gt;
bool setAllAccountData ( account theAccount, table theData )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. There seems to be a function for this in the source&lt;br /&gt;
areStreetLightsEnabled ( )&lt;br /&gt;
areBackgroundGunshotsEnabled ( )&lt;br /&gt;
areBirdsEnabled ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater. Gotta find a way to set it for all peds, not just for the local player&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreate ( ) -- Triggered when an element was created&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreate ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
setRainLevel&lt;br /&gt;
setFogDistance -- TODO: Rename to setFarClipDistance; timecyc.dat is such a great mess I only noticed this was wrong when I tried to reorganize the darn file&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setLightningEnabled&lt;br /&gt;
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it&lt;br /&gt;
setSandStormEnabled&lt;br /&gt;
&lt;br /&gt;
-- Some more stuff that might be good to give scripters control of (all from timecyc.dat)&lt;br /&gt;
setAmbienceColor -- Sets the color (filter) of objects (or so I assume)&lt;br /&gt;
setDirectLightColor -- Sets the color (filter) of vehicles and peds&lt;br /&gt;
setSunColor&lt;br /&gt;
setSunSize&lt;br /&gt;
setSpriteBrightness&lt;br /&gt;
setShadowIntensity&lt;br /&gt;
setLightShadingValue&lt;br /&gt;
setFarClipDistance -- NOTE: Rename setFogDistance to this, as it's more correct (and appears this way in timecyc.dat)&lt;br /&gt;
setFogStartDistance&lt;br /&gt;
setLightOnGround&lt;br /&gt;
setLowerCloudColor -- NOTE: It is assumed that this is the clouds which sort of fly around low, the type of clouds which aren't disabled yet by setCloudsEnabled. Thus, important&lt;br /&gt;
setUpperCloudColor&lt;br /&gt;
setColorCorrection&lt;br /&gt;
&lt;br /&gt;
-- Prolly the heck of a lot more&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
Variables I've discovered through playing around with Cheat Engine&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables. Got these from Cheat Engine as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
! Assembly&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
| mov byte ptr [edi+008e4cd0],02&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
| mov byte ptr [ebp+10],03&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
| mov byte ptr [ebx+008e4cd0],01&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TODOcument==&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getRainLevel ( )&lt;br /&gt;
setRainLevel ( float rainLevel )&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
getFogDistance ( )&lt;br /&gt;
setFogDistance ( float distance )&lt;br /&gt;
resetFogDistance ( )&lt;br /&gt;
&lt;br /&gt;
areInteriorSoundsEnabled ( )&lt;br /&gt;
setInteriorSoundsEnabled ( bool enabled )&lt;br /&gt;
&lt;br /&gt;
isElementFrozen ( element theElement ) -- Also mark the functions it replaced as &amp;quot;deprecated&amp;quot;&lt;br /&gt;
setElementFrozen ( element theElement, bool frozen ) -- Same here, of course&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Element map properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Vehicle:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Ped:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Object:&lt;br /&gt;
&lt;br /&gt;
- frozen     = bool frozen&lt;br /&gt;
- collisions = bool collisionsEnabled&lt;br /&gt;
- scale      = float objectScale&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24674</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24674"/>
		<updated>2010-12-08T21:16:45Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. There seems to be a function for this in the source&lt;br /&gt;
areStreetLightsEnabled ( )&lt;br /&gt;
areBackgroundGunshotsEnabled ( )&lt;br /&gt;
areBirdsEnabled ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater. Gotta find a way to set it for all peds, not just for the local player&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreate ( ) -- Triggered when an element was created&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreate ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
setRainLevel&lt;br /&gt;
setFogDistance&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setLightningEnabled&lt;br /&gt;
setLightOnGround&lt;br /&gt;
setSunStuff -- Some stuff concerning the sun in timecyc.dat, gotta see what I can make out of that&lt;br /&gt;
setShadowStuff -- Same here&lt;br /&gt;
setMoonSize -- Like if you shoot the moon, it resizes. Hopefully it will be possible to hide it altogether, or make some sort of half-moon out of it&lt;br /&gt;
setSandStormEnabled&lt;br /&gt;
-- Prolly the heck of a lot more&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
P.S. x86: fix setWeatherBlended, nao&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
Variables I've discovered through playing around with Cheat Engine&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables. Got these from Cheat Engine as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
! Assembly&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
| mov byte ptr [edi+008e4cd0],02&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
| mov byte ptr [ebp+10],03&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
| mov byte ptr [ebx+008e4cd0],01&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TODOcument==&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getRainLevel ( )&lt;br /&gt;
setRainLevel ( float rainLevel )&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
getFogDistance ( )&lt;br /&gt;
setFogDistance ( float distance )&lt;br /&gt;
resetFogDistance ( )&lt;br /&gt;
&lt;br /&gt;
areInteriorSoundsEnabled ( )&lt;br /&gt;
setInteriorSoundsEnabled ( bool enabled )&lt;br /&gt;
&lt;br /&gt;
isElementFrozen ( element theElement ) -- Also mark the functions it replaced as &amp;quot;deprecated&amp;quot;&lt;br /&gt;
setElementFrozen ( element theElement, bool frozen ) -- Same here, of course&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Element map properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Vehicle:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Ped:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Object:&lt;br /&gt;
&lt;br /&gt;
- frozen     = bool frozen&lt;br /&gt;
- collisions = bool collisionsEnabled&lt;br /&gt;
- scale      = float objectScale&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24668</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24668"/>
		<updated>2010-12-07T16:46:02Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. Gotta find the address D:&lt;br /&gt;
areStreetLightsEnabled ( )&lt;br /&gt;
areBackgroundGunshotsEnabled ( )&lt;br /&gt;
areBirdsEnabled ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreated ( ) -- Said it will be very slow, but still, it's a quite useful event. Besides, if onElementDestroyed isn't slow, why would this be slow?&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
setRainLevel&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setFogDensity&lt;br /&gt;
setLightningEnabled -- (I really hope there is some way to separate lightning from rainy weathers)&lt;br /&gt;
-- Anything else?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
P.S. x86: fix setWeatherBlended, nao&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
Variables I've discovered through playing around with Cheat Engine&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Fog distance&lt;br /&gt;
| 0x0B7C4F0&lt;br /&gt;
| float&lt;br /&gt;
| Sets a shitload of other variables as well; Lags at a very high values&lt;br /&gt;
|-&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables. Got these from Cheat Engine as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
! Assembly&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Fog distance&lt;br /&gt;
| 0x55fcc8, 0x5613a3 &amp;amp; 0x560a23&lt;br /&gt;
| d9 5e 50&lt;br /&gt;
| fstp dword ptr [esi+50]&lt;br /&gt;
| NOP-ing (one of) these functions causes LSODs when close to an obstacle on foot&lt;br /&gt;
|-&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
| mov byte ptr [edi+008e4cd0],02&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
| mov byte ptr [ebp+10],03&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
| mov byte ptr [ebx+008e4cd0],01&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==TODOcument==&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
getRainLevel ( )&lt;br /&gt;
setRainLevel ( float rainLevel )&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
areInteriorSoundsEnabled ( )&lt;br /&gt;
setInteriorSoundsEnabled ( bool enabled )&lt;br /&gt;
&lt;br /&gt;
isElementFrozen ( element theElement ) -- Also mark the functions it replaced as &amp;quot;deprecated&amp;quot;&lt;br /&gt;
setElementFrozen ( element theElement, bool frozen ) -- Same here, of course&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Element map properties===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
Vehicle:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Ped:&lt;br /&gt;
&lt;br /&gt;
- frozen = bool frozen&lt;br /&gt;
&lt;br /&gt;
Object:&lt;br /&gt;
&lt;br /&gt;
- frozen     = bool frozen&lt;br /&gt;
- collisions = bool collisionsEnabled&lt;br /&gt;
- scale      = float objectScale&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24642</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24642"/>
		<updated>2010-12-01T15:31:19Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. Gotta find the address D:&lt;br /&gt;
areStreetLightsEnabled&lt;br /&gt;
areBackgroundGunshotsEnabled&lt;br /&gt;
areBirdsEnabled&lt;br /&gt;
&lt;br /&gt;
setRainLevel ( float level ) -- Internally defined and &amp;quot;working&amp;quot;, but not used. Needs slight fixing&lt;br /&gt;
getRainLevel ( ) -- Make an educated guess&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreated ( ) -- Said it will be very slow, but still, it's a quite useful event. Besides, if onElementDestroyed isn't slow, why would this be slow?&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setRainLevel&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setFogDensity&lt;br /&gt;
setLightningEnabled -- (I really hope there is some way to separate lightning from rainy weathers)&lt;br /&gt;
-- Anything else?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
P.S. x86: fix setWeatherBlended, nao&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
Variables I've discovered through playing around with Cheat Engine&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Rain&lt;br /&gt;
| 0x0C81324&lt;br /&gt;
| float&lt;br /&gt;
| Maximum used in SA: 1; Decreases over time; Doesn't create thunder; Already in the MTA source; Creates heavy static at high values&lt;br /&gt;
|-&lt;br /&gt;
| Fog distance&lt;br /&gt;
| 0x0B7C4F0&lt;br /&gt;
| float&lt;br /&gt;
| Sets a shitload of other variables as well; Lags at a very high values&lt;br /&gt;
|-&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables. Got these from Cheat Engine as well.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
! Assembly&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Rain&lt;br /&gt;
| 0x072bc92 &amp;amp; 0x072c686&lt;br /&gt;
| d9 1d 24 13 c8 00&lt;br /&gt;
| fstp dword ptr [00c81324]&lt;br /&gt;
| NOP-ing (one of) these functions causes LSODs when getting into vehicles&lt;br /&gt;
|-&lt;br /&gt;
| Fog distance&lt;br /&gt;
| 0x55fcc8, 0x5613a3 &amp;amp; 0x560a23&lt;br /&gt;
| d9 5e 50&lt;br /&gt;
| fstp dword ptr [esi+50]&lt;br /&gt;
| NOP-ing (one of) these functions causes LSODs when close to an obstacle on foot&lt;br /&gt;
|-&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
| -&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
| mov byte ptr [edi+008e4cd0],02&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
| mov byte ptr [ebp+10],03&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights enabler&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
| mov byte ptr [ebx+008e4cd0],01&lt;br /&gt;
| Didn't try NOP-ing this function yet&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24637</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24637"/>
		<updated>2010-11-30T17:53:28Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. Gotta find the address D:&lt;br /&gt;
areStreetLightsEnabled&lt;br /&gt;
areBackgroundGunshotsEnabled&lt;br /&gt;
areBirdsEnabled&lt;br /&gt;
&lt;br /&gt;
setRainLevel ( float level ) -- Internally defined and &amp;quot;working&amp;quot;, but not used. Needs slight fixing&lt;br /&gt;
getRainLevel ( ) -- Make an educated guess&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
setPedBreath ( ped thePed, float breath ) -- For breath, as used underwater&lt;br /&gt;
getPedBreath ( ped thePed )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreated ( ) -- Said it will be very slow, but still, it's a quite useful event. Besides, if onElementDestroyed isn't slow, why would this be slow?&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setRainLevel&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setFogDensity&lt;br /&gt;
setLightningEnabled -- (I really hope there is some way to separate lightning from rainy weathers)&lt;br /&gt;
-- Anything else?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
P.S. x86: fix setWeatherBlended, nao&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
===Variables===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Rain&lt;br /&gt;
| 0x0C81324&lt;br /&gt;
| float&lt;br /&gt;
| Maximum: 1; Decreases over time; Doesn't appear to create thunder; Already in the MTA source&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights&lt;br /&gt;
| 0x0960CF4&lt;br /&gt;
| bool (byte)&lt;br /&gt;
| Automatically 1 at night (in LS); Setting this to 0 causes a new light corona to be created at all LS street lights&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Functions===&lt;br /&gt;
&lt;br /&gt;
Functions which are setting the above variables&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Related to&lt;br /&gt;
! Address&lt;br /&gt;
! Bytes&lt;br /&gt;
|-&lt;br /&gt;
| Rain&lt;br /&gt;
| 0x072bc92 &amp;amp; 0x072c686&lt;br /&gt;
| d9 1d 24 13 c8 00&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights&lt;br /&gt;
| 0x0408989&lt;br /&gt;
| c6 87 d0 4c 8e 00 02&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights&lt;br /&gt;
| 0x040cea3&lt;br /&gt;
| c6 45 10 03&lt;br /&gt;
|-&lt;br /&gt;
| LS Street lights&lt;br /&gt;
| 0x040cb71&lt;br /&gt;
| c6 83 d0 4c 8e 00 01&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24632</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24632"/>
		<updated>2010-11-29T16:39:05Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setAreaSoundsEnabled ( bool toggle ) -- Sounds for several interiors. Got to try and find this address as well (might merge setBackgroundGunshotsEnabled with this function, as gunshots are an LS area sound, iirc)&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. Gotta find the address D:&lt;br /&gt;
areStreetLightsEnabled&lt;br /&gt;
areBackgroundGunshotsEnabled&lt;br /&gt;
areAreaSoundsEnabled&lt;br /&gt;
areBirdsEnabled&lt;br /&gt;
&lt;br /&gt;
setRainLevel ( float level ) -- Internally defined and &amp;quot;working&amp;quot;, but not used. Needs slight fixing&lt;br /&gt;
getRainLevel ( ) -- Make an educated guess&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreated ( ) -- Said it will be very slow, but still, it's a quite useful event. Besides, if onElementDestroyed isn't slow, why would this be slow?&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setRainLevel&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setFogDensity&lt;br /&gt;
setLightningEnabled -- (I really hope there is some way to separate lightning from rainy weathers)&lt;br /&gt;
-- Anything else?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
P.S. x86: fix setWeatherBlended, nao&lt;br /&gt;
&lt;br /&gt;
==Memory addresses==&lt;br /&gt;
&lt;br /&gt;
Here are a couple of memory addresses which might be useful for implementing new functions, so I can't forget them.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Purpose&lt;br /&gt;
! Address&lt;br /&gt;
! Address type&lt;br /&gt;
! Comments&lt;br /&gt;
|-&lt;br /&gt;
| Interior music toggle&lt;br /&gt;
| 00B6DCBC&lt;br /&gt;
| Bool (byte)&lt;br /&gt;
| Automatically set to 1 when entering any interior.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Want to add another function / event?==&lt;br /&gt;
&lt;br /&gt;
Feel free to edit this page. The more suggestions there are, the more '''''*might*''''' be implemented.&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24628</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24628"/>
		<updated>2010-11-29T10:18:29Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setVehicleNitrousActivated ( vehicle theVehicle, bool toggle ) -- Being able to influence NOS would be great (should block GTA from disabling it as well)&lt;br /&gt;
isVehicleNitrousActivated ( vehicle theVehicle ) -- Obvious function is obvious&lt;br /&gt;
setVehicleNitrousRechargeDelay ( vehicle theVehicle, int delay ) -- Function to set the amount of time the driver has to wait to reactivate NOS&lt;br /&gt;
getVehicleNitrousRechargeDelay ( vehicle theVehicle )&lt;br /&gt;
&lt;br /&gt;
setStreetLightsEnabled ( bool toggle ) -- Got to try and find the address for this first though&lt;br /&gt;
setBackgroundGunshotsEnabled ( bool toggle ) -- Gotta find this one as well.. again...&lt;br /&gt;
setAreaSoundsEnabled ( bool toggle ) -- Sounds for several interiors. Got to try and find this address as well (might merge setBackgroundGunshotsEnabled with this function, as gunshots are an LS area sound, iirc)&lt;br /&gt;
setBirdsEnabled ( bool toggle ) -- I hate those pesky poopers at times.. Besides, it doesn't fit in some circumstances.. Gotta find the address D:&lt;br /&gt;
areStreetLightsEnabled&lt;br /&gt;
areBackgroundGunshotsEnabled&lt;br /&gt;
areAreaSoundsEnabled&lt;br /&gt;
areBirdsEnabled&lt;br /&gt;
&lt;br /&gt;
setRainLevel ( float level ) -- Internally defined and &amp;quot;working&amp;quot;, but not used. Needs slight fixing&lt;br /&gt;
getRainLevel ( ) -- Make an educated guess&lt;br /&gt;
resetRainLevel ( )&lt;br /&gt;
&lt;br /&gt;
isEventAdded ( string eventName ) -- Should be fairly obvious&lt;br /&gt;
isEventHandlerAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious as well&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreated ( ) -- Said it will be very slow, but still, it's a quite useful event. Besides, if onElementDestroyed isn't slow, why would this be slow?&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
onClientVehicleDamage ( float loss ) -- Server-side version already exists, if only there'd be an easy way for it client-side...&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Weather functions==&lt;br /&gt;
&lt;br /&gt;
'''Warning:''' This section is for serious weathermen only!&lt;br /&gt;
&lt;br /&gt;
I recently noticed how many functions MTA actually has to influence the weather. It would be quite awesome if we would be able to influence litterally every factor.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- We currently have&lt;br /&gt;
setWaveHeight&lt;br /&gt;
setSkyGradient&lt;br /&gt;
setWindVelocity&lt;br /&gt;
setCloudsEnabled&lt;br /&gt;
setWaterColor&lt;br /&gt;
&lt;br /&gt;
-- We'll need&lt;br /&gt;
setRainLevel&lt;br /&gt;
setHeatWaveIntensity&lt;br /&gt;
setFogDensity&lt;br /&gt;
setLightningEnabled -- (I really hope there is some way to separate lightning from rainy weathers)&lt;br /&gt;
-- Anything else?&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
P.S. x86: fix setWeatherBlended, nao&lt;br /&gt;
&lt;br /&gt;
==Want to add another function / event?==&lt;br /&gt;
&lt;br /&gt;
Feel free to edit this page. The more suggestions there are, the more '''''*might*''''' be implemented.&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24627</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24627"/>
		<updated>2010-11-28T20:28:35Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
isEventAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onElementCreated ( ) -- Said it will be very slow, but still, it's a quite useful event. Besides, if onElementDestroyed isn't slow, why would this be slow?&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Want to add another function / event?==&lt;br /&gt;
&lt;br /&gt;
Feel free to edit this page. The more suggestions there are, the more '''''*might*''''' be implemented.&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnSettingChange&amp;diff=24626</id>
		<title>OnSettingChange</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnSettingChange&amp;diff=24626"/>
		<updated>2010-11-28T20:20:22Z</updated>

		<summary type="html">&lt;p&gt;Snert: Created page with &amp;quot;__NOTOC__  {{Server event}} This event is triggered when resource setting has been changed. For instance, this event would trigger if you would edit the settings of the Race reso...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when resource setting has been changed. For instance, this event would trigger if you would edit the settings of the Race resource through the Admin panel.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string setting, string oldValue, string newValue&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''setting''': The setting which was changed. For instance: &amp;quot;*race.ghostmode&amp;quot;&lt;br /&gt;
*'''oldValue''': The previous value. Please note that this value is in [[JSON]]. To get a normal Lua value, use [[fromJSON]]&lt;br /&gt;
*'''newValue''': The new value. Also in [[JSON]]&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[root element]].&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/Server event|Server events}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs_Example]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Server_events&amp;diff=24625</id>
		<title>Template:Server events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Server_events&amp;diff=24625"/>
		<updated>2010-11-28T20:15:47Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[onBan]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
*[[onDebugMessage]]&lt;br /&gt;
*[[onSettingChange]]&lt;br /&gt;
}}&lt;br /&gt;
*[[onUnban]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24624</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24624"/>
		<updated>2010-11-28T18:05:41Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of on(Client)DebugMessage.&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2091 and later)&lt;br /&gt;
&lt;br /&gt;
===Camo vehicles===&lt;br /&gt;
&lt;br /&gt;
When this resource is enabled, boats will get the same color as the water, and planes will get the same color as the sky. What's not to like?&lt;br /&gt;
&lt;br /&gt;
Created as an example to demonstrate the use of getWaterColor, getSkyGradient and RGB vehicle colors.&lt;br /&gt;
&lt;br /&gt;
  Camoplane example: http://www.xfire.com/video/3bcb4b/&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/camovehs.zip Download] ('''Note:''' Only works in 1.1 r2093 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
isEventAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onSettingChange ( string name, var oldValue, var newValue ) -- Should be quite obvious. Detecting settings changes can be quite useful for dynamic resources&lt;br /&gt;
onElementCreated ( ) -- Said it will be very slow, but still, it's a quite useful event. Besides, if onElementDestroyed isn't slow, why would this be slow?&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Want to add another function / event?==&lt;br /&gt;
&lt;br /&gt;
Feel free to edit this page. The more suggestions there are, the more '''''*might*''''' be implemented.&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24623</id>
		<title>User:Snert</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=User:Snert&amp;diff=24623"/>
		<updated>2010-11-28T13:06:21Z</updated>

		<summary type="html">&lt;p&gt;Snert: Removed implemented functions from my TODO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Resources==&lt;br /&gt;
&lt;br /&gt;
===Debug monitor===&lt;br /&gt;
&lt;br /&gt;
Resource to easily be able to view server and client debug messages. (remotely)&lt;br /&gt;
&lt;br /&gt;
Images:&lt;br /&gt;
  Server-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_s.png&lt;br /&gt;
  Client-side debug message viewer: http://dl.dropbox.com/u/4504893/images/debugmonitor_editor_c.png&lt;br /&gt;
&lt;br /&gt;
[http://dl.dropbox.com/u/4504893/misc/debugmonitor.zip Download] ('''Note:''' Only works in 1.1 r2019 and later)&lt;br /&gt;
&lt;br /&gt;
==Function suggestions==&lt;br /&gt;
&lt;br /&gt;
Some functions I should work on sometime soon. (sort of my &amp;quot;TODO&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- None at the moment&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Both===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setElementFrozen ( element theElement, bool toggle ) -- Would replace setPedFrozen, setVehicleFrozen and setObjectStatic&lt;br /&gt;
isEventAdded ( string eventName, element attachedTo[, function handlerFunction ] ) -- Should be fairly obvious&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Event suggestions==&lt;br /&gt;
&lt;br /&gt;
Events which might be quite useful. I should work on these sometime soon.&lt;br /&gt;
&lt;br /&gt;
===Server-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onSettingChange ( string name, var oldValue, var newValue ) -- Should be quite obvious. Detecting settings changes can be quite useful for dynamic resources&lt;br /&gt;
onElementCreated ( ) -- Said it will be very slow, but still, it's a quite useful event. Besides, if onElementDestroyed isn't slow, why would this be slow?&lt;br /&gt;
onVehicleNitrousActivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleNitrousDeactivated ( ) -- Should be fairly obvious&lt;br /&gt;
onVehicleTireStateChanged ( int tire, int state ) -- If you'd want vehicles with bulletproof wheels or something, you'd need to detect the state change first&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Client-side===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
onClientElementCreated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousActivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleNitrousDeactivated ( ) -- See server-side&lt;br /&gt;
onClientVehicleTireStateChanged ( int tire, int state ) -- See server-side&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==FX functions==&lt;br /&gt;
&lt;br /&gt;
Doomed_Space_Marine did [http://www.youtube.com/watch?v=mifR-dyFx6s|some research on some particle effects on custom models]. It would be very cool if we could make functions to do this instead, like we already can with some particle effects. (for instance: [[fxAddBlood]]) This would especially be very cool if we would be able to alter the fx, so for instance we could create colored smoke.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
fxAddHeliKillBlood&lt;br /&gt;
fxAddCarWashEffect&lt;br /&gt;
fxAddCement&lt;br /&gt;
fxAddClouds -- Note: It's a rather vague type of effect&lt;br /&gt;
fxAddCokeTrail&lt;br /&gt;
fxAddShower -- Note: Classed as &amp;quot;some water effect&amp;quot;, but unknown what type of water effect. Assuming shower&lt;br /&gt;
fxAddSmoke&lt;br /&gt;
fxAddPour -- Seems more like it should be fxAddPee or fxAddPiss though&lt;br /&gt;
fxAddLeaves&lt;br /&gt;
fxAddSpray&lt;br /&gt;
fxAddFireExtinghuiserEffect&lt;br /&gt;
fxAddFlamethrowerFlame&lt;br /&gt;
fxAddInsects&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Want to add another function / event?==&lt;br /&gt;
&lt;br /&gt;
Feel free to edit this page. The more suggestions there are, the more '''''*might*''''' be implemented.&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetWaterColor&amp;diff=24620</id>
		<title>ResetWaterColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetWaterColor&amp;diff=24620"/>
		<updated>2010-11-27T18:09:23Z</updated>

		<summary type="html">&lt;p&gt;Snert: How hard can copying be?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function reset the water color of the GTA world to default.&lt;br /&gt;
&lt;br /&gt;
{{New_feature|3.0110|1.1|&lt;br /&gt;
resetWaterColor will work server-side as well. In 1.0.4 and lower, resetWaterColor is only available client-side.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool resetWaterColor ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if water color was reset correctly, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example adds a command ''resetwatercolor'' with which a player can reset the water colour.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeWaterBackToNormal ()&lt;br /&gt;
    resetWaterColor ()&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;resetwatercolor&amp;quot;, changeWaterBackToNormal )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetWaterColor&amp;diff=24619</id>
		<title>ResetWaterColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetWaterColor&amp;diff=24619"/>
		<updated>2010-11-27T18:09:07Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function reset the water color of the GTA world to default.&lt;br /&gt;
&lt;br /&gt;
{{New_feature|3.0110|1.1|&lt;br /&gt;
resetWaterColor will work server-side as well. In 1.0.4 and lower, setWaterColor is only available client-side.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool resetWaterColor ()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if water color was reset correctly, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example adds a command ''resetwatercolor'' with which a player can reset the water colour.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeWaterBackToNormal ()&lt;br /&gt;
    resetWaterColor ()&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;resetwatercolor&amp;quot;, changeWaterBackToNormal )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Water_functions&amp;diff=24618</id>
		<title>Template:Water functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Water_functions&amp;diff=24618"/>
		<updated>2010-11-27T18:08:31Z</updated>

		<summary type="html">&lt;p&gt;Snert: Forgetfulness ftw&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[createWater]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[getWaterColor]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getWaterVertexPosition]]&lt;br /&gt;
*[[getWaveHeight]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[resetWaterColor]]&lt;br /&gt;
* [[setWaterColor]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setWaterLevel]]&lt;br /&gt;
*[[setWaterVertexPosition]]&lt;br /&gt;
*[[setWaveHeight]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_water_functions&amp;diff=24617</id>
		<title>Template:Client water functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_water_functions&amp;diff=24617"/>
		<updated>2010-11-27T18:07:38Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[createWater]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[getWaterColor]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getWaterVertexPosition]]&lt;br /&gt;
*[[getWaterLevel]]&lt;br /&gt;
*[[getWaveHeight]]&lt;br /&gt;
*[[resetWaterColor]]&lt;br /&gt;
*[[setWaterColor]]&lt;br /&gt;
*[[setWaterLevel]]&lt;br /&gt;
*[[setWaterVertexPosition]]&lt;br /&gt;
*[[setWaveHeight]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Water_functions&amp;diff=24616</id>
		<title>Template:Water functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Water_functions&amp;diff=24616"/>
		<updated>2010-11-27T18:05:14Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[createWater]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[getWaterColor]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getWaterVertexPosition]]&lt;br /&gt;
*[[getWaveHeight]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[setWaterColor]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setWaterLevel]]&lt;br /&gt;
*[[setWaterVertexPosition]]&lt;br /&gt;
*[[setWaveHeight]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:World_functions&amp;diff=24615</id>
		<title>Template:World functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:World_functions&amp;diff=24615"/>
		<updated>2010-11-27T18:01:45Z</updated>

		<summary type="html">&lt;p&gt;Snert: Whoops&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New feature|3.0110|1.1|&lt;br /&gt;
* [[areTrafficLightsLocked]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getCloudsEnabled]]&lt;br /&gt;
*[[getGameSpeed]]&lt;br /&gt;
*[[getGravity]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[getSkyGradient]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getTime]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[getTrafficLightState]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getWeather]]&lt;br /&gt;
*[[getZoneName]]&lt;br /&gt;
*[[isGarageOpen]]&lt;br /&gt;
*[[resetSkyGradient]]&lt;br /&gt;
*[[setCloudsEnabled]]&lt;br /&gt;
*[[setGameSpeed]]&lt;br /&gt;
*[[setGarageOpen]]&lt;br /&gt;
*[[setGravity]]&lt;br /&gt;
*[[setMinuteDuration]]&lt;br /&gt;
*[[setSkyGradient]]&lt;br /&gt;
*[[setTime]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[setTrafficLightState]]&lt;br /&gt;
* [[setTrafficLightsLocked]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setWeather]]&lt;br /&gt;
*[[setWeatherBlended]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetWaterColor&amp;diff=24614</id>
		<title>GetWaterColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetWaterColor&amp;diff=24614"/>
		<updated>2010-11-27T18:00:52Z</updated>

		<summary type="html">&lt;p&gt;Snert: Created page with &amp;quot;__NOTOC__ {{Server client function}} This function returns the water color of the GTA world.  '''Note:''' The server can only return the water color, if it has actually been set ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function returns the water color of the GTA world.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' The server can only return the water color, if it has actually been set by script.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int, int, int, int getWaterColor ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns 4 [[int|ints]], indicating the color of the water. (RGBA)&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;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:World_functions&amp;diff=24613</id>
		<title>Template:World functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:World_functions&amp;diff=24613"/>
		<updated>2010-11-27T17:55:14Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New feature|3.0110|1.1|&lt;br /&gt;
* [[areTrafficLightsLocked]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getCloudsEnabled]]&lt;br /&gt;
*[[getGameSpeed]]&lt;br /&gt;
*[[getGravity]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[getSkyGradient]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getTime]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[getTrafficLightState]]&lt;br /&gt;
* [[getWaterColor]]&lt;br /&gt;
}}&lt;br /&gt;
*[[getWeather]]&lt;br /&gt;
*[[getZoneName]]&lt;br /&gt;
*[[isGarageOpen]]&lt;br /&gt;
*[[resetSkyGradient]]&lt;br /&gt;
*[[setCloudsEnabled]]&lt;br /&gt;
*[[setGameSpeed]]&lt;br /&gt;
*[[setGarageOpen]]&lt;br /&gt;
*[[setGravity]]&lt;br /&gt;
*[[setMinuteDuration]]&lt;br /&gt;
*[[setSkyGradient]]&lt;br /&gt;
*[[setTime]]&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
* [[setTrafficLightState]]&lt;br /&gt;
* [[setTrafficLightsLocked]]&lt;br /&gt;
* [[setWaterColor]]&lt;br /&gt;
}}&lt;br /&gt;
*[[setWeather]]&lt;br /&gt;
*[[setWeatherBlended]]&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWaterColor&amp;diff=24612</id>
		<title>SetWaterColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWaterColor&amp;diff=24612"/>
		<updated>2010-11-27T17:53:03Z</updated>

		<summary type="html">&lt;p&gt;Snert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function changes the water color of the GTA world.&lt;br /&gt;
&lt;br /&gt;
{{New_feature|3.0110|1.1|&lt;br /&gt;
setWaterColor will work server-side as well. In 1.0.4 and lower, setWaterColor is only available client-side.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setWaterColor ( int red, int green, int blue, [ int alpha = 200 ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''red:''' The ''red'' value of the water, from 0 to 255.&lt;br /&gt;
*'''green:''' The ''green'' value of the water, from 0 to 255.&lt;br /&gt;
*'''blue:''' The ''blue'' value of the water, from 0 to 255.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''alpha:''' The ''alpha'' (visibility) value of the water, from 0 to 255. Defaults to 200 if not declared.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if water color was set correctly, ''false'' if invalid values were passed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example adds a command ''watercolor'' with which a player can change the water colour.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeWaterColor ( commandName, red, green, blue, alpha )&lt;br /&gt;
    -- if alpha is input, then include it too&lt;br /&gt;
    alpha = tonumber ( alpha ) or 200&lt;br /&gt;
    red = tonumber ( red )&lt;br /&gt;
    green = tonumber ( green )&lt;br /&gt;
    blue = tonumber ( blue )&lt;br /&gt;
    -- check if the colour values for red, green and blue are valid&lt;br /&gt;
    if red and green and blue then&lt;br /&gt;
        setWaterColor ( red, green, blue, alpha )&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox ( &amp;quot;Failed to change the water colour!&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;watercolor&amp;quot;, changeWaterColor )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>Snert</name></author>
	</entry>
</feed>