<?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=Zangomangu</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=Zangomangu"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Zangomangu"/>
	<updated>2026-04-25T17:37:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineSetModelLODDistance&amp;diff=81792</id>
		<title>EngineSetModelLODDistance</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineSetModelLODDistance&amp;diff=81792"/>
		<updated>2025-02-03T19:23:22Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: fixed distance&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets a custom LOD distance for any object / model ID. This is the distance at which objects of that model ID are switched to their LOD model, or (if there is no LOD model) become invisible.&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
The actual draw distance used is modified by the draw distance slider in the settings 'Video' tab of the MTA client.&lt;br /&gt;
&lt;br /&gt;
*When the 'Video' tab draw distance slider is 0%, the engineSetModelLODDistance setting approximately matches the draw distance used.&lt;br /&gt;
:''e.g. engineSetModelLODDistance(1337,100) will mean model 1337 will be visible up to a distance of '''100''' units.''&lt;br /&gt;
&lt;br /&gt;
*When the 'Video' tab draw distance slider is 100%, the engineSetModelLODDistance setting is approximately doubled before use.&lt;br /&gt;
:''e.g. engineSetModelLODDistance(1337,100) will mean model 1337 will be visible up to a distance of '''200''' units.''&lt;br /&gt;
&lt;br /&gt;
However, there is a general draw distance limit of 325 units. So engineSetModelLODDistance(1337,400) will mean model 1337 will be visible up to a distance of 325 units no matter what the 'Video' tab says.&lt;br /&gt;
&lt;br /&gt;
Therefore, unless it's really important, engineSetModelLODDistance should not be set to anything greater than 170.&amp;lt;br&amp;gt;&lt;br /&gt;
170 will still give the maximum draw distance (of 325 units) on clients that have a 'Video' tab draw distance setting of 100%, and it will help reduce lag for players who chose a lower draw distance in their settings.&lt;br /&gt;
&lt;br /&gt;
'''Note for low LOD [[object]]s''':&lt;br /&gt;
*The limit is 325 units, but the actual draw distance used is 5 times the setting value. Also, they ignore the 'Video' tab draw distance slider. So a setting of 200 will mean a low LOD element will always have a draw distance of '''1000''' units.&lt;br /&gt;
&lt;br /&gt;
'''Note for low LOD [[building]]s''':&lt;br /&gt;
*The distance must be set greater than 300 for a low LOD building in order to work correctly. Otherwise, the low LOD will always be visible. The actual draw distance is NOT 5 times the setting value.&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 engineSetModelLODDistance ( int model, float distance [, bool extendedLod = false ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||Engine.setModelLODDistance}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''model:''' The model / object ID number you want to change the LOD distance of.&lt;br /&gt;
*'''distance:''' New LOD distance value in San Andreas units.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22676|&lt;br /&gt;
*'''extendedLod:''' Allows to set a greater distance than the current 325 units.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function executed succesfully, ''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;
-- Cause massive lag by maxing out draw distance of all objects&lt;br /&gt;
&lt;br /&gt;
local objectsTable = getElementsByType(&amp;quot;object&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
for i = 1, #objectsTable do&lt;br /&gt;
	local objectElement = objectsTable[i]&lt;br /&gt;
	local objectModel = getElementModel(objectElement)&lt;br /&gt;
&lt;br /&gt;
	engineSetModelLODDistance(objectModel, 325) -- Set maximum draw distance&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will, besides replacing with custom map objects, also set the LOD distance accordingly, a necessary step (otherwise the object could seem to fail loading and only show up 1 feet away)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function replaceObjects()&lt;br /&gt;
&lt;br /&gt;
	local col1 = engineLoadCOL(&amp;quot;map1.col&amp;quot;)&lt;br /&gt;
	local col2 = engineLoadCOL(&amp;quot;map2.col&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	local txd = engineLoadTXD(&amp;quot;map.txd&amp;quot;)&lt;br /&gt;
	engineImportTXD(txd, 2357)&lt;br /&gt;
	engineImportTXD(txd, 2290)&lt;br /&gt;
&lt;br /&gt;
	local dff1 = engineLoadDFF(&amp;quot;map1.dff&amp;quot;)&lt;br /&gt;
	local dff2 = engineLoadDFF(&amp;quot;map2.dff&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	engineReplaceCOL(col1, 2357)&lt;br /&gt;
	engineReplaceCOL(col2, 2290)&lt;br /&gt;
	engineReplaceModel(dff1, 2357)&lt;br /&gt;
	engineReplaceModel(dff2, 2290)&lt;br /&gt;
&lt;br /&gt;
	engineSetModelLODDistance(2357, 325)&lt;br /&gt;
	engineSetModelLODDistance(2290, 325)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example shows how to use LOD's with buildings&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function createMyPyramid()&lt;br /&gt;
    local pos = Vector3(0, 0, 3)&lt;br /&gt;
    local rot = Vector3(0, 0, 0)&lt;br /&gt;
    &lt;br /&gt;
    local modelHi = 8395  -- This model has a lot of polygons&lt;br /&gt;
    local modelLow = 8701 -- This model is optimized for drawing at a long distance&lt;br /&gt;
&lt;br /&gt;
    -- Always call this function if you don't like default draw distance&lt;br /&gt;
    -- or you allocated the model with using engineRequestModel&lt;br /&gt;
    engineSetModelLODDistance(modelHi, 100, true)&lt;br /&gt;
    engineSetModelLODDistance(modelLow, 500, true)&lt;br /&gt;
&lt;br /&gt;
    local lod = createBuilding(modelLow, pos, rot)&lt;br /&gt;
    local building = createBuilding(modelHi, pos, rot)&lt;br /&gt;
&lt;br /&gt;
    setLowLODElement(building,lod)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.6.0-9.22676|Added extendedLod argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[getVehiclesLODDistance]]&lt;br /&gt;
* [[resetVehiclesLODDistance]]&lt;br /&gt;
* [[setVehiclesLODDistance]]&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineSetModelLODDistance&amp;diff=81784</id>
		<title>EngineSetModelLODDistance</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineSetModelLODDistance&amp;diff=81784"/>
		<updated>2025-02-02T14:26:09Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Added notes on object/building lod difference&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets a custom LOD distance for any object / model ID. This is the distance at which objects of that model ID are switched to their LOD model, or (if there is no LOD model) become invisible.&lt;br /&gt;
&lt;br /&gt;
'''Notes:'''&lt;br /&gt;
The actual draw distance used is modified by the draw distance slider in the settings 'Video' tab of the MTA client.&lt;br /&gt;
&lt;br /&gt;
*When the 'Video' tab draw distance slider is 0%, the engineSetModelLODDistance setting approximately matches the draw distance used.&lt;br /&gt;
:''e.g. engineSetModelLODDistance(1337,100) will mean model 1337 will be visible up to a distance of '''100''' units.''&lt;br /&gt;
&lt;br /&gt;
*When the 'Video' tab draw distance slider is 100%, the engineSetModelLODDistance setting is approximately doubled before use.&lt;br /&gt;
:''e.g. engineSetModelLODDistance(1337,100) will mean model 1337 will be visible up to a distance of '''200''' units.''&lt;br /&gt;
&lt;br /&gt;
However, there is a general draw distance limit of 300 units. So engineSetModelLODDistance(1337,400) will mean model 1337 will be visible up to a distance of 300 units no matter what the 'Video' tab says.&lt;br /&gt;
&lt;br /&gt;
Therefore, unless it's really important, engineSetModelLODDistance should not be set to anything greater than 170.&amp;lt;br&amp;gt;&lt;br /&gt;
170 will still give the maximum draw distance (of 300 units) on clients that have a 'Video' tab draw distance setting of 100%, and it will help reduce lag for players who chose a lower draw distance in their settings.&lt;br /&gt;
&lt;br /&gt;
'''Note for low LOD [[object]]s''':&lt;br /&gt;
*The limit is 300 units, but the actual draw distance used is 5 times the setting value. Also, they ignore the 'Video' tab draw distance slider. So a setting of 200 will mean a low LOD element will always have a draw distance of '''1000''' units.&lt;br /&gt;
&lt;br /&gt;
'''Note for low LOD [[building]]s''':&lt;br /&gt;
*The distance must be set greater than 300 in order to work correctly. Otherwise the low LOD will always be visible. The actual draw distance is NOT 5 times the setting value.&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 engineSetModelLODDistance ( int model, float distance [, bool extendedLod = false ] ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||Engine.setModelLODDistance}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''model:''' The model / object ID number you want to change the LOD distance of.&lt;br /&gt;
*'''distance:''' New LOD distance value in San Andreas units.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22676|&lt;br /&gt;
*'''extendedLod:''' Allows to set a greater distance than the current 325 units.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function executed succesfully, ''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;
-- Cause massive lag by maxing out draw distance of all objects&lt;br /&gt;
&lt;br /&gt;
local objectsTable = getElementsByType(&amp;quot;object&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
for i = 1, #objectsTable do&lt;br /&gt;
	local objectElement = objectsTable[i]&lt;br /&gt;
	local objectModel = getElementModel(objectElement)&lt;br /&gt;
&lt;br /&gt;
	engineSetModelLODDistance(objectModel, 300) -- Set maximum draw distance&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example will, besides replacing with custom map objects, also set the LOD distance accordingly, a neccesary step (otherwise the object could seem to fail loading and only show up 1 feet away)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function replaceObjects()&lt;br /&gt;
&lt;br /&gt;
	local col1 = engineLoadCOL(&amp;quot;map1.col&amp;quot;)&lt;br /&gt;
	local col2 = engineLoadCOL(&amp;quot;map2.col&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	local txd = engineLoadTXD(&amp;quot;map.txd&amp;quot;)&lt;br /&gt;
	engineImportTXD(txd, 2357)&lt;br /&gt;
	engineImportTXD(txd, 2290)&lt;br /&gt;
&lt;br /&gt;
	local dff1 = engineLoadDFF(&amp;quot;map1.dff&amp;quot;)&lt;br /&gt;
	local dff2 = engineLoadDFF(&amp;quot;map2.dff&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	engineReplaceCOL(col1, 2357)&lt;br /&gt;
	engineReplaceCOL(col2, 2290)&lt;br /&gt;
	engineReplaceModel(dff1, 2357)&lt;br /&gt;
	engineReplaceModel(dff2, 2290)&lt;br /&gt;
&lt;br /&gt;
	engineSetModelLODDistance(2357, 2000)&lt;br /&gt;
	engineSetModelLODDistance(2290, 2000)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.6.0-9.22676|Added extendedLod argument}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[getVehiclesLODDistance]]&lt;br /&gt;
* [[resetVehiclesLODDistance]]&lt;br /&gt;
* [[setVehiclesLODDistance]]&lt;br /&gt;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Projectiles&amp;diff=78585</id>
		<title>Template:Projectiles</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Projectiles&amp;diff=78585"/>
		<updated>2023-11-14T22:50:13Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Moved note on hydra flare to createProjectile&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: auto; text-align: center; table-layout: fixed;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!ID&lt;br /&gt;
!Name/Description&lt;br /&gt;
|-&lt;br /&gt;
|'''16'''&lt;br /&gt;
|Grenade&lt;br /&gt;
|-&lt;br /&gt;
|'''17'''&lt;br /&gt;
|Tear Gas Grenade&lt;br /&gt;
|-&lt;br /&gt;
|'''18'''&lt;br /&gt;
|Molotov&lt;br /&gt;
|-&lt;br /&gt;
|'''19'''&lt;br /&gt;
|Rocket (simple)&lt;br /&gt;
|-&lt;br /&gt;
|'''20'''&lt;br /&gt;
|Rocket (heat seeking)&lt;br /&gt;
|-&lt;br /&gt;
|'''21'''&lt;br /&gt;
|Air Bomb&lt;br /&gt;
|-&lt;br /&gt;
|'''39'''&lt;br /&gt;
|Satchel Charge&lt;br /&gt;
|-&lt;br /&gt;
|'''58'''&lt;br /&gt;
|Hydra flare&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=CreateProjectile&amp;diff=78584</id>
		<title>CreateProjectile</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=CreateProjectile&amp;diff=78584"/>
		<updated>2023-11-14T22:50:00Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Moved note on hydra flare&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function creates a projectile of the specified type on the specified coordinates.&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
*'''Model''' argument is not synchronized between clients. Clients differs from local player see always standard projectile model.&lt;br /&gt;
*'''Target''' argument can only be defined as a player or another projectile.&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;
projectile createProjectile ( element creator, int weaponType [, float posX, float posY, float posZ, float force = 1.0, element target = nil, float rotX, float rotY, float rotZ, float velX, float velY, float velZ, int model ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Projectile]]}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''creator:''' The [[element]] representing creator of the projectile. In case you want the projectile to be synced for everybody creator must be the local player or his vehicle.&lt;br /&gt;
*'''weaponType:''' [[int]] representing the projectile weaponType (characteristics). Valid IDs are:&lt;br /&gt;
{{Projectiles}}&lt;br /&gt;
&lt;br /&gt;
'''Note''': ID 58 doesn't work &amp;lt;ref&amp;gt;https://github.com/multitheftauto/mtasa-blue/issues/1927&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
*'''posX''', '''posY''', '''posZ''': [[float]] starting coordinates for the projectile. They are coordinates of creator by default.&lt;br /&gt;
*'''force''': [[float]] representing the starting force for throwable projectiles.&lt;br /&gt;
*'''target''': [[element]] target used for heat seeking rockets.&lt;br /&gt;
*'''rotX''', '''rotY''', '''rotZ''': [[float]] starting rotation for the projectile.&lt;br /&gt;
*'''velX''', '''velY''', '''velZ''': [[float]] starting velocity for the projectile.&lt;br /&gt;
*'''model''': Integer representing the projectile's model, uses default model for weaponType if not specified.&lt;br /&gt;
&lt;br /&gt;
==Returns==&lt;br /&gt;
Returns a ''[[projectile]]'' element if [[projectile]] creation was successful. Returns ''false'' if unable to create a [[projectile]] (wrong weapon ID or projectiles limit was reached).&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example makes a rocket minigun (minigun shooting with rockets).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- This function gets triggered everytime player shoots.&lt;br /&gt;
function onClientPlayerWeaponFireFunc(weapon,ammo,ammoInClip,hitX,hitY,hitZ,hitElement)&lt;br /&gt;
	if weapon == 38 then -- if source is a local player and he uses minigun...&lt;br /&gt;
                x,y,z = getElementPosition(localPlayer)&lt;br /&gt;
		if not createProjectile(localPlayer,19,x,y,z,200) then -- then we either create a projectile...&lt;br /&gt;
			outputChatBox ( &amp;quot;Rocket minigun overheated! Give it a rest pal!&amp;quot;, source ) -- or if projectile limit is reached we output player a chat message&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Don't forget to add the onClientPlayerWeaponFireFunc function as a handler for onClientPlayerWeaponFire.&lt;br /&gt;
addEventHandler(&amp;quot;onClientPlayerWeaponFire&amp;quot;, localPlayer, onClientPlayerWeaponFireFunc)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example code shoots a projectile from your occupied vehicle that travels in the direction your vehicle is facing when you press vehicle_fire (left mouse button with default controls)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
function shootProjectile()&lt;br /&gt;
	local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
	-- Only create projectile if we are inside a vehicle&lt;br /&gt;
	if(vehicle)then&lt;br /&gt;
		local x, y, z = getElementPosition(vehicle)&lt;br /&gt;
		createProjectile(vehicle, 19, x, y, z)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
bindKey(&amp;quot;vehicle_fire&amp;quot;, &amp;quot;down&amp;quot;, shootProjectile)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues== &lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|584|createProjectile creates one projectile for every person in the vehicle}}&lt;br /&gt;
{{Issue|616|Projectile rotation is set exactly opposite for creator}}&lt;br /&gt;
}} &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
{{Client projectile functions}}&lt;br /&gt;
&lt;br /&gt;
[[it:createProjectile]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Player_events&amp;diff=78583</id>
		<title>Template:Player events</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Player_events&amp;diff=78583"/>
		<updated>2023-11-14T22:47:32Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: added two events&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerACInfo]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerBan]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerChangeNick]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerChat]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerClick]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerCommand]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerConnect]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerContact]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerDamage]]&amp;lt;/li&amp;gt;&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22293|&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerDetonateSatchels]]&amp;lt;/li&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerJoin]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerLogin]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerLogout]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerMarkerHit]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerMarkerLeave]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerModInfo]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerMute]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerNetworkStatus]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerPickupHit]]&amp;lt;/li&amp;gt;&lt;br /&gt;
{{New items|3.0156|1.5.5|&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerPickupLeave]]&amp;lt;/li&amp;gt;&lt;br /&gt;
|11783}}&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerPickupUse]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerPrivateMessage]]&amp;lt;/li&amp;gt;&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22293|&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerProjectileCreation]]&amp;lt;/li&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerQuit]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerScreenShot]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerSpawn]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerStealthKill]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerTarget]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerUnmute]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerVehicleEnter]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerVehicleExit]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerVoiceStart]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerVoiceStop]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerWasted]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerWeaponFire]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[onPlayerWeaponSwitch]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Events templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerDetonateSatchels&amp;diff=78582</id>
		<title>OnPlayerDetonateSatchels</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerDetonateSatchels&amp;diff=78582"/>
		<updated>2023-11-14T22:43:24Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Created page with &amp;quot;__NOTOC__ {{Server event}} {{Added feature/item|1.6.1|1.6.0|22293|This event is triggered every time satchels are detonated - either by a player or through detonateSatchels.}} ==Parameters== No parameters.  ==Source== The source of this event is the player whose satchels are being detonated.  ===Canceling=== If this event is canceled, the satchels will not detonate.  ==Example== &amp;lt;syntaxhighlight lang=&amp;quot;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22293|This event is triggered every time satchels are detonated - either by a [[player]] or through [[detonateSatchels]].}}&lt;br /&gt;
==Parameters==&lt;br /&gt;
No parameters.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] whose satchels are being detonated.&lt;br /&gt;
&lt;br /&gt;
===Canceling===&lt;br /&gt;
If this event is [[Event system #Canceling|canceled]], the satchels will not detonate.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerProjectileCreation&amp;diff=78581</id>
		<title>OnPlayerProjectileCreation</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerProjectileCreation&amp;diff=78581"/>
		<updated>2023-11-14T22:35:22Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Created page with &amp;quot;__NOTOC__ {{Server event}} {{Added feature/item|1.6.1|1.6.0|22293|This event is triggered every time a projectile is created by a player - either through a weapon, a vehicle weapon or createProjectile.}} ==Parameters== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; int weaponType, float x, float y, float z, float force, element target, float rotX, float rotY, float rotZ, float velX, float velY, float velZ &amp;lt;/syntaxhighlight&amp;gt; *'''weaponType:''' ID, see below {{Projectiles}} *'''x:''...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
{{Added feature/item|1.6.1|1.6.0|22293|This event is triggered every time a projectile is created by a [[player]] - either through a weapon, a vehicle weapon or [[createProjectile]].}}&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int weaponType, float x, float y, float z, float force, element target, float rotX, float rotY, float rotZ, float velX, float velY, float velZ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''weaponType:''' ID, see below&lt;br /&gt;
{{Projectiles}}&lt;br /&gt;
*'''x:''' X coordinate of where the projectile was created&lt;br /&gt;
*'''y:''' Y coordinate of where the projectile was created&lt;br /&gt;
*'''z:''' Z coordinate of where the projectile was created&lt;br /&gt;
*'''force:''' force of thrown projectile. Valid for ID 16, 17, 18, 39.&lt;br /&gt;
*'''target:''' [[element]] the projectile is targeting. Valid for ID 19, 20.&lt;br /&gt;
*'''rotX:''' X rotation. Valid for ID 19, 20.&lt;br /&gt;
*'''rotY:''' Y rotation. Valid for ID 19, 20.&lt;br /&gt;
*'''rotZ:''' Z rotation. Valid for ID 19, 20.&lt;br /&gt;
*'''velX:''' X axis velocity. Valid for ID 16, 17, 18, 19, 20, 39.&lt;br /&gt;
*'''velY:''' Y axis velocity. Valid for ID 16, 17, 18, 19, 20, 39.&lt;br /&gt;
*'''velZ:''' Z axis velocity. Valid for ID 16, 17, 18, 19, 20, 39.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who created the projectile.&lt;br /&gt;
&lt;br /&gt;
===Canceling===&lt;br /&gt;
If this event is [[Event system #Canceling|canceled]], the projectile will not be created for other players on the server.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWaterLevel&amp;diff=78313</id>
		<title>SetWaterLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWaterLevel&amp;diff=78313"/>
		<updated>2023-10-22T23:09:09Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: remove deprecated syntax&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
Sets the height of some or all the water in the game world.&lt;br /&gt;
{{Note|When the water level is 0, the standard GTA rendering is performed so that water is visible when viewed through translucent surfaces, such as vehicle windows. However, some MTA custom objects placed underwater will appear in front of the water. Setting the water level to any non-zero value (i.e. setWaterLevel(0.001) ) forces alternative rendering and MTA custom objects placed underwater will be drawn correctly.}}&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setWaterLevel ( [ water theWater, ] float level )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20716|&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setWaterLevel ( float level [, bool includeWaterFeatures = true, bool includeWaterElements = true, bool includeWorldSea = true, bool includeOutsideWorldSea = false ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{OOP||[[water]]:setLevel|level|getWaterLevel}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''level:''' the new Z coordinate of the water surface. All water in the game world is set to this height.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''theWater:''' the water element to change.&lt;br /&gt;
&lt;br /&gt;
''or:''&lt;br /&gt;
{{New feature/item|3.0120|1.2||&lt;br /&gt;
*'''includeWaterFeatures :''' a boolean indicating whether to also set the level of water features such as ponds and pools.&lt;br /&gt;
*'''includeWaterElements :''' a boolean indicating whether to also set the level of all water elements.&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20716|&lt;br /&gt;
*'''includeWorldSea :''' a boolean indicating whether to set the level of the sea water&lt;br /&gt;
*'''includeOutsideWorldSea:''' a boolean indicating whether to also set the level of sea water outside the world area, ie. outside -3000, 3000.&lt;br /&gt;
}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' in case of failure.&lt;br /&gt;
&lt;br /&gt;
== Alternate client-only syntax ==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client only&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setWaterLevel ( [float x, float y, float z,] float level )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''level:''' the new Z coordinate of the water surface&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
The area of water containing that point or corresponding to that water element is changed.&lt;br /&gt;
&lt;br /&gt;
*'''x:''' the X coordinate of the point indicating the water area to change.&lt;br /&gt;
*'''y:''' the Y coordinate of the point indicating the water area to change.&lt;br /&gt;
*'''z:''' the Z coordinate of the point indicating the water area to change. This parameter is reserved and is currently ignored, set it to 0.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' in case of failure (there is no water at the specified coordinates).&lt;br /&gt;
&amp;lt;/section&amp;gt;&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 example code will slowly drain away all rivers and seas.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local level = 0&lt;br /&gt;
&lt;br /&gt;
function drainSomeWater()&lt;br /&gt;
    level = level - 0.01&lt;br /&gt;
    setWaterLevel ( level )&lt;br /&gt;
end&lt;br /&gt;
setTimer ( drainSomeWater, 100, 15000 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example code will slowly drain away all rivers and seas.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local level = 0&lt;br /&gt;
&lt;br /&gt;
function drainSomeWater()&lt;br /&gt;
    level = level - 0.01&lt;br /&gt;
    setWaterLevel ( level )&lt;br /&gt;
end&lt;br /&gt;
setTimer ( drainSomeWater, 100, 15000 )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example code adds a command ''water'' which can be used to change the current water level.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;water&amp;quot;,&lt;br /&gt;
    function ( thePlayer, command, level )&lt;br /&gt;
        if level and tonumber ( level ) then -- if we have input something and if it is actually a number value&lt;br /&gt;
            setWaterLevel ( tonumber( level ) ) -- change the water level&lt;br /&gt;
            outputChatBox ( &amp;quot;Waterlevel is now: &amp;quot; .. level ) -- send a message to everyone to inform about the change&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client water functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Resource:Editor&amp;diff=77917</id>
		<title>Resource:Editor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Resource:Editor&amp;diff=77917"/>
		<updated>2023-10-06T18:31:57Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Resource page}}&lt;br /&gt;
The MTA:SA map editor allows you to create maps for gamemodes.&lt;br /&gt;
&lt;br /&gt;
==Starting==&lt;br /&gt;
To start the editor, simply click the &amp;quot;Map editor&amp;quot; menu item in the main MTA menu.&lt;br /&gt;
&lt;br /&gt;
==Menus==&lt;br /&gt;
Once the editor has started, you are presented with two menu bars: the main menu at the top, and the element menu in the lower left.&lt;br /&gt;
&lt;br /&gt;
===Main menu===&lt;br /&gt;
These are the buttons in the main menu:&lt;br /&gt;
* [[Image:Editor_New.png]] Create a new map.&lt;br /&gt;
* [[Image:Editor_Open.png]] Open an existing map.&lt;br /&gt;
* [[Image:Editor_Save.png]] Save the map you're working on.&lt;br /&gt;
* [[Image:Editor_Save_as.png]] Save your map under a different name.&lt;br /&gt;
* [[Image:Editor_Options.png]] Alter general map editor settings.&lt;br /&gt;
* [[Image:Editor_Undo.png]] Undo the last action.&lt;br /&gt;
* [[Image:Editor_Redo.png]] Restore the last undone action.&lt;br /&gt;
* [[Image:Editor_Locations.png]] Stored game world locations. The editor comes with a great list of San Andreas Interior locations but you can also add your own interior and non-interior locations to the list.&lt;br /&gt;
* [[Image:Editor_Current_elements.png]] List all the elements the map contains (objects, vehicles, markers, pickups etc.)&lt;br /&gt;
* [[Image:Editor_Map_settings.png]] Map specific settings, like time of day, gravity etc. Here you can also specify what gamemodes the map is compatible with.&lt;br /&gt;
* [[Image:Editor_Definitions.png]] Load [[Resource:Editor/EDF|editor definition files (EDF)]] that you want to use. &lt;br /&gt;
* [[Image:Editor_Test.png]] Go into play mode to try out the map. This will load up the gamemode the map is made for.&lt;br /&gt;
&lt;br /&gt;
===Element menu===&lt;br /&gt;
The element menu is used to add new elements to the map.&lt;br /&gt;
* [[Image:Editor_Vehicle.png]] Create a new vehicle.&lt;br /&gt;
* [[Image:Editor_Object.png]] Create a new object (buildings, roads and other scenery).&lt;br /&gt;
* [[Image:Editor_Pickup.png]] Create a new pickup (health, armor, weapons and custom).&lt;br /&gt;
* [[Image:Editor_Marker.png]] Create a new marker (checkpoint, ring, cylinder, arrow and corona).&lt;br /&gt;
* [[File:Crosshair.png‎]]      Select world object.&lt;br /&gt;
* [[Image:Editor_WorldObjectRemover.png]] Delete world object.&lt;br /&gt;
Additionally, if you have [[Resource:Editor/EDF|editor definitions loaded]], you can roll the mousewheel in this menu to bring up custom elements.&lt;br /&gt;
&lt;br /&gt;
==Using the editor==&lt;br /&gt;
This section explains how to create and modify maps.&lt;br /&gt;
&lt;br /&gt;
===Moving around the map===&lt;br /&gt;
When you initially start the editor, you are in ''camera mode''.  You are able to use the '''WASD''' keys to move the camera and the mouse to pan the camera.  While moving around, you can hold '''ALT''' to move more slowly or '''SHIFT''' to go faster.&lt;br /&gt;
&lt;br /&gt;
To access the editor's interface and control panel you need to switch to ''cursor mode''.  You can toggle between cursor mode and camera mode with the '''F''' key.  When in cursor mode,  your view is fixed, and you can use the mouse cursor to manipulate elements and use the graphical interface.&lt;br /&gt;
&lt;br /&gt;
Camera mode can be recognized by a crosshair in the center of the screen. You can use it to select and move elements just like in cursor mode.&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Crosshair.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Starting a new map===&lt;br /&gt;
* Start the editor, or if it is already started, click the ''New'' menu button.&lt;br /&gt;
* Click the ''Map settings'' button. In the ''Meta'' tab, fill in the Name and Author fields with the name of the map and your name respectively. Also open the ''Gamemodes'' tab and add the gamemodes your map is meant for (they will be moved to the ''Added gamemodes'' list). You can do this by selecting them and clicking ''Add'', or by double clicking them. Click OK when you're done.&lt;br /&gt;
[[Image:Editor_Mapsettings.png|center]]&lt;br /&gt;
* Click the ''Definitions'' window and add the resources of which you want to use the custom elements. These will consist of the gamemodes you selected in the ''Map settings'' window, plus eventual additional resources. For more information about editor definitions, see [[Resource:Editor/EDF|EDF]]. Click OK when you're done.&lt;br /&gt;
&lt;br /&gt;
===Creating new elements===&lt;br /&gt;
Adding elements to your map, such as vehicles and objects, is very straightforward.&lt;br /&gt;
* If you are in camera mode, switch to cursor mode first by pressing '''F'''.&lt;br /&gt;
* Click the button in the element menu that represents what you want. E.g., click the button with a car on it to add a vehicle.&lt;br /&gt;
* A new element of the selected type will be created and attached to your cursor. Move it to the location where you want it and '''left click''' to drop it off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Addelem.png|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To create custom elements that are specific to a resource, hover the cursor over the element menu and turn the scroll wheel until the desired resource comes up. Note that for this to work, you first have to add the [[Resource:Editor/EDF|EDF]] file of the resource in the ''Definitions'' window.&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Selectedf.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Selecting===&lt;br /&gt;
* '''Left click''' an element to select it in ''keyboard mode''.&lt;br /&gt;
* '''Right click''' it to select it in ''mouse mode''.&lt;br /&gt;
* Press the '''Spacebar''' or click in an empty area to deselect.&lt;br /&gt;
&lt;br /&gt;
The selected element, if any, is denoted by a yellow cone marker.  Elements (particularly objects) with poor collisions can be detected easier by enabling ''High sensitivity mode'', by pressing the '''E''' key.  This increases detection at the expense of accuracy.&lt;br /&gt;
&lt;br /&gt;
The ''Current elements'' dialog can also be used to select elements.  Double-clicking an item within the list will select it in ''Keyboard mode''.&lt;br /&gt;
&lt;br /&gt;
===Moving===&lt;br /&gt;
Moving elements can be done in several ways.&lt;br /&gt;
&lt;br /&gt;
'''With the mouse'''&lt;br /&gt;
* Simply drag and drop with the '''left mouse button'''.&lt;br /&gt;
Or:&lt;br /&gt;
* Select the element in mouse mode ('''right click'''), move it to where you want it, and click to drop it off.&lt;br /&gt;
&lt;br /&gt;
You can also adjust the ''Hold distance'' of an element toward and away from the camera by switching to camera mode, '''right clicking''' the element, and rolling the '''mouse wheel'''.&lt;br /&gt;
&lt;br /&gt;
'''With the keyboard'''&lt;br /&gt;
* Select the element in keyboard mode ('''left click''').&lt;br /&gt;
* Use the '''arrow keys''' to move the element in the horizontal plane, and '''PgUp'''/'''PgDn''' to move it vertically. Hold '''ALT''' to decrease the movement speed, or '''SHIFT''' to increase it.&lt;br /&gt;
&lt;br /&gt;
By default, elements move relative to the camera and are not locked to any axes.  This can be disabled in the ''Options'' menu.&lt;br /&gt;
&lt;br /&gt;
===Rotating===&lt;br /&gt;
'''With the mouse'''&lt;br /&gt;
&lt;br /&gt;
You can rotate selected elements around the Z axis with the mouse wheel.&lt;br /&gt;
* Select the element in keyboard mode ('''left click''') and roll the mouse wheel while holding '''Left CTRL'''.&lt;br /&gt;
Or:&lt;br /&gt;
* Select the element in mouse mode ('''right click'''), hold '''CTRL''', and roll the mouse wheel.&lt;br /&gt;
&lt;br /&gt;
'''With the keyboard'''&lt;br /&gt;
* Select the element in keyboard mode ('''left click''').&lt;br /&gt;
* While holding '''CTRL''' (the selection marker will turn green), use the '''arrow keys''' and '''PgUp'''/'''PgDn''' to rotate the element around the different axes.&lt;br /&gt;
&lt;br /&gt;
With both methods you can additionally hold '''ALT''' to decrease the rotation speed or '''SHIFT''' to increase it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Rotateelem.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Changing model and other properties===&lt;br /&gt;
Most elements have a variety of options that can be altered to change their appearance and behaviour. Examples are the model, color and visual upgrades of a car.&lt;br /&gt;
&lt;br /&gt;
* Open the properties window of an element by either double clicking it or by selecting it and pressing '''F3'''.&lt;br /&gt;
* Make any alterations that you want. For example, to change the model of a car or object, click the '''Browse''' button next to &amp;quot;model&amp;quot; to open the model browser.&lt;br /&gt;
* Click OK when you're done.&lt;br /&gt;
&lt;br /&gt;
[[Image:Editor_Props.png|center]]&lt;br /&gt;
&lt;br /&gt;
===Cloning===&lt;br /&gt;
You can clone an element by selecting it and pressing '''C'''. &lt;br /&gt;
&lt;br /&gt;
* In mouse mode the cloned element will be attached to your cursor. '''Left click''' to place it in the map.&lt;br /&gt;
* In keyboard mode the cloned element will be cloned in the identical position.&lt;br /&gt;
&lt;br /&gt;
If you hold '''CTRL''' while clicking, the element will be cloned again and will again be attached to the cursor. This way you can easily place large quantities of something.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can use the ''Pullout'' button located in the bottom-right corner of the properties box to clone an element.&lt;br /&gt;
&lt;br /&gt;
===Deleting===&lt;br /&gt;
Simply select the element and press '''DEL''' ''(Delete)''.&lt;br /&gt;
&lt;br /&gt;
Alternatively you can use the ''Pullout'' button located in the bottom-right corner of the properties box to delete an element.&lt;br /&gt;
&lt;br /&gt;
==Creating maps for specific gamemodes==&lt;br /&gt;
To make a map for a specific gamemode, you have to do two things:&lt;br /&gt;
* Click the '''Map Settings''' button in the top menu, go to the '''Gamemodes''' tab and add any gamemodes that your map is to be used with.&lt;br /&gt;
* You will likely also need to add one or more [[Resource:Editor/EDF|Editor Definition Files]]. These will allow you to place gamemode specific elements in the map, like spawnpoints, race checkpoints, or CTF flags. You can add EDF's by clicking the '''Definitions''' menu button and adding the relevant gamemodes.&lt;br /&gt;
&lt;br /&gt;
==Controls==&lt;br /&gt;
Here is a list of all default controls. To change them please go to the MTA Settings menu while the Editor is started.&lt;br /&gt;
&lt;br /&gt;
===Camera===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| camera_move_forwards&lt;br /&gt;
| '''w'''&lt;br /&gt;
|-&lt;br /&gt;
| camera_move_backwards&lt;br /&gt;
| '''s'''&lt;br /&gt;
|-&lt;br /&gt;
| camera_move_left&lt;br /&gt;
| '''a'''&lt;br /&gt;
|-&lt;br /&gt;
| camera_move_right&lt;br /&gt;
| '''d'''&lt;br /&gt;
|-&lt;br /&gt;
| high_sensitivity_mode&lt;br /&gt;
| '''e'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Cloning===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| clone_selected_element&lt;br /&gt;
| '''c'''&lt;br /&gt;
|-&lt;br /&gt;
| clone_drop_modifier&lt;br /&gt;
| '''lctrl''' || ''(Left CTRL)''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Element manipulation===&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
| element_move_forward&lt;br /&gt;
| '''arrow_u''' || ''(Arrow key Up)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_backward&lt;br /&gt;
| '''arrow_d''' || ''(Arrow key Down)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_left&lt;br /&gt;
| '''arrow_l''' || ''(Arrow key Left)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_right&lt;br /&gt;
| '''arrow_r''' || ''(Arrow key Right)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_downwards&lt;br /&gt;
| '''pgdn''' || ''(Page Down)''&lt;br /&gt;
|-&lt;br /&gt;
| element_move_upwards&lt;br /&gt;
| '''pgup''' || ''(Page Up)''&lt;br /&gt;
|-&lt;br /&gt;
| zoom_in&lt;br /&gt;
| '''mouse_wheel_down'''&lt;br /&gt;
|-&lt;br /&gt;
| zoom_out&lt;br /&gt;
| '''mouse_wheel_up'''&lt;br /&gt;
|-&lt;br /&gt;
| quick_rotate_increase&lt;br /&gt;
| '''mod_rotate''' + '''mouse_wheel_up''' || ''(Left CTRL + Mouse wheel Up)''&lt;br /&gt;
|-&lt;br /&gt;
| quick_rotate_decrease&lt;br /&gt;
| '''mod_rotate''' + '''mouse_wheel_down''' || ''(Left CTRL + Mouse wheel Down)''&lt;br /&gt;
|-&lt;br /&gt;
| mod_rotate&lt;br /&gt;
| '''lctrl''' || ''(Left CTRL)''&lt;br /&gt;
|-&lt;br /&gt;
| mod_slow_speed&lt;br /&gt;
| '''lalt''' || ''(Left ALT)''&lt;br /&gt;
|-&lt;br /&gt;
| mod_fast_speed&lt;br /&gt;
| '''lshift''' || ''(Left SHIFT)''&lt;br /&gt;
|-&lt;br /&gt;
| destroy_selected_element&lt;br /&gt;
| '''delete'''&lt;br /&gt;
|-&lt;br /&gt;
| drop_selected_element&lt;br /&gt;
| '''space'''&lt;br /&gt;
|-&lt;br /&gt;
| pickup_selected_element&lt;br /&gt;
| '''F2'''&lt;br /&gt;
|-&lt;br /&gt;
| reset_rotation&lt;br /&gt;
| '''mod_rotate''' + '''r''' || ''(Left CTRL + R)''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===GUI===&lt;br /&gt;
{|&lt;br /&gt;
| toggle_gui_display&lt;br /&gt;
| '''F4'''&lt;br /&gt;
|-&lt;br /&gt;
| toggle_cursor&lt;br /&gt;
| '''f'''&lt;br /&gt;
|-&lt;br /&gt;
| select_target_keyboard&lt;br /&gt;
| '''mouse1''' || ''(Left Mouse button)''&lt;br /&gt;
|-&lt;br /&gt;
| select_target_mouse&lt;br /&gt;
| '''mouse2''' || ''(Right Mouse button)''&lt;br /&gt;
|-&lt;br /&gt;
| edf_next&lt;br /&gt;
| '''mouse_wheel_up'''&lt;br /&gt;
|-&lt;br /&gt;
| edf_prev&lt;br /&gt;
| '''mouse_wheel_down'''&lt;br /&gt;
|-&lt;br /&gt;
| undo&lt;br /&gt;
| '''Ctrl''' + '''z'''&lt;br /&gt;
|-&lt;br /&gt;
| redo&lt;br /&gt;
| '''Ctrl''' + '''y'''&lt;br /&gt;
|-&lt;br /&gt;
| properties_toggle&lt;br /&gt;
| '''F3'''&lt;br /&gt;
|-&lt;br /&gt;
| browser_up&lt;br /&gt;
| '''arrow_u''' || ''(Arrow key Up)''&lt;br /&gt;
|-&lt;br /&gt;
| browser_down&lt;br /&gt;
| '''arrow_d''' || ''(Arrow key Down)''&lt;br /&gt;
|-&lt;br /&gt;
| browser_zoom_in&lt;br /&gt;
| '''mouse_wheel_up'''&lt;br /&gt;
|-&lt;br /&gt;
| browser_zoom_out&lt;br /&gt;
| '''mouse_wheel_down'''&lt;br /&gt;
|-&lt;br /&gt;
| browser_confirm&lt;br /&gt;
| '''enter'''&lt;br /&gt;
|-&lt;br /&gt;
| currentelements_up&lt;br /&gt;
| '''num_8''' || ''(Numpad key 8)''&lt;br /&gt;
|-&lt;br /&gt;
| currentelements_down&lt;br /&gt;
| '''num_2''' || ''(Numpad key 2)''&lt;br /&gt;
|-&lt;br /&gt;
| toggle_test&lt;br /&gt;
| '''F5'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Multiplayer==&lt;br /&gt;
The editor is built with both serverside and clientside components, and therefore supports multiplayer out of the box.  To use the editor in multiplayer with other players, simply copy all of the editor's resources into your server, start the '''editor''' resource and allow other players to join.&lt;br /&gt;
&lt;br /&gt;
Please note that currently the editor lacks any permissions system, so all users have access to every function.&lt;br /&gt;
&lt;br /&gt;
==Plugins &amp;amp; External resources==&lt;br /&gt;
{{Main|Resource:Editor/Plugins}}&lt;br /&gt;
&lt;br /&gt;
The editor allows basic importing of elements from external resources.  This is useful for resources that may have to manipulate an element in a specific way that cannot be performed by the editor.  For example, a map resource which uses custom models (and has a script to import these models) cannot be manipulated by default within the editor.  &lt;br /&gt;
&lt;br /&gt;
By using the '''import &amp;lt;resourceName&amp;gt;''' command in console the resource's elements can be imported within the editor.&lt;br /&gt;
&lt;br /&gt;
==FAQ==&lt;br /&gt;
==== I get a black screen when launching the Map Editor  ====&lt;br /&gt;
&lt;br /&gt;
Usually this is caused due to incorrect installation of Map Editor resources. If you are using a stable MTASA client, please install it again and make sure that you use Client and Server install option.&lt;br /&gt;
&lt;br /&gt;
If you are using a nightly build, to get it working right you need to download latest [https://github.com/multitheftauto/mtasa-resources resources (step 3)], unpack the archive and put its contents in:&lt;br /&gt;
''MTA San Andreas\server\mods\deathmatch\resources'' , where ''MTA San Andreas'' is a folder where you've installed MTA San Andreas (default location: C:\Program Files\MTA San Andreas).&lt;br /&gt;
&lt;br /&gt;
Putting them in this path: MTA San Andreas\mods\deathmatch\resources '''is a common mistake''' - it won't work if you put them there. So make sure to put them in the ''italic'' path above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If this issue still occurs, even when you've checked the note above and verified that you've installed it correctly, it might be because you've got an outdated '''acl.xml''' file.   You can find the default one [https://github.com/multitheftauto/mtasa-blue/blob/master/Server/mods/deathmatch/acl.xml here].  It should be placed in '''server/mods/deathmatch/''' in your MTA: San Andreas installation directory.&lt;br /&gt;
&lt;br /&gt;
==== I get an &amp;quot;Could not start the local server. See console for details&amp;quot; when using the  &amp;quot;Map Editor&amp;quot; button ====&lt;br /&gt;
This is because you do not have a valid editor.conf installed.  You can find the default one [https://github.com/multitheftauto/mtasa-blue/blob/master/Server/mods/deathmatch/editor.conf here].  It should be placed in '''server/mods/deathmatch/''' in your MTA: San Andreas installation directory.&lt;br /&gt;
&lt;br /&gt;
==== I have saved a map but cannot find it in my server's resources directory, despite the Editor itself being able to see it ====&lt;br /&gt;
This is due to the fact that Vista/7 limits write-access for non-admin processes in Program Files directory. Files get written in the &amp;quot;VirtualStore&amp;quot; directory instead of real Program Files folder.  You should be able to locate your map resource in a similar directory to:&lt;br /&gt;
 C:\Users\&amp;lt;USERNAME&amp;gt;\AppData\Local\VirtualStore\Program Files\MTA San Andreas\server\mods\deathmatch\resources\&lt;br /&gt;
&lt;br /&gt;
Running the Server/MTA San Andreas with Administrative rights will allow the map to be saved to the proper location.&lt;br /&gt;
&lt;br /&gt;
==== I have some other problem with the map editor ====&lt;br /&gt;
&lt;br /&gt;
Sometimes resetting the map editor will solve certain issues. The easiest way to do that is install MTA:SA to a brand new folder. Otherwise you can try the following steps:&lt;br /&gt;
::1. Go to the resources folder, '''server/mods/deathmatch/resources/''' and delete the '''editor_dump''' directory&lt;br /&gt;
::2. Go to the resources folder, '''server/mods/deathmatch/resources/''' and delete the '''editor_test''' directory&lt;br /&gt;
&lt;br /&gt;
==== I have found a bug or have a suggestion/feedback for the map editor ====&lt;br /&gt;
Please use the official [https://github.com/multitheftauto/mtasa-resources/issues github issues] for reporting bugs.  Feel free to also join us on [http://www.mtasa.com/discord Discord].&lt;br /&gt;
&lt;br /&gt;
[[hu:Resource:Editor]]&lt;br /&gt;
[[ru:Resource:Editor]]&lt;br /&gt;
[[es:Resource:Editor]]&lt;br /&gt;
[[tr:Resource:Editor]]&lt;br /&gt;
[[pt-br:Resource:Editor]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=77747</id>
		<title>Template:Client world functions</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Template:Client_world_functions&amp;diff=77747"/>
		<updated>2023-09-30T16:17:52Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;ul&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[areTrafficLightsLocked]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[createSWATRope]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getAircraftMaxHeight]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getAircraftMaxVelocity]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getBirdsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22188|&lt;br /&gt;
&amp;lt;li&amp;gt;[[getColorFilter]]&amp;lt;/li&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;li&amp;gt;[[getCloudsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getCoronaReflectionsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getFarClipDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getFogDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getGameSpeed]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getGarageBoundingBox]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getGaragePosition]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getGarageSize]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getGravity]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getGroundPosition]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getHeatHaze]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getInteriorFurnitureEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getInteriorSoundsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getJetpackMaxHeight]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getMinuteDuration]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getMoonSize]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getNearClipDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getOcclusionsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getPedsLODDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getPlayerBlurLevel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getRainLevel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20675|&lt;br /&gt;
&amp;lt;li&amp;gt;[[getRoofPosition]]&amp;lt;/li&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;li&amp;gt;[[getScreenFromWorldPosition]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getSunColor]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getSunSize]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getTime]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getTrafficLightState]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getVehiclesLODDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getWeather]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getWindVelocity]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getWorldFromScreenPosition]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[getZoneName]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[isAmbientSoundEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[isGarageOpen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[isLineOfSightClear]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[isWorldSoundEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[isWorldSpecialPropertyEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22219|&lt;br /&gt;
&amp;lt;li&amp;gt;[[processLineAgainstMesh]]&amp;lt;/li&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;li&amp;gt;[[processLineOfSight]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[removeWorldModel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetAmbientSounds]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetBlurLevel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetColorFilter]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetCoronaReflectionsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetFarClipDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetFogDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetHeatHaze]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetMoonSize]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetNearClipDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetPedsLODDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetRainLevel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetSkyGradient]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetSunColor]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetSunSize]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetVehiclesLODDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetWindVelocity]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[resetWorldSounds]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[restoreAllWorldModels]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[restoreWorldModel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setAircraftMaxHeight]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setAircraftMaxVelocity]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setAmbientSoundEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setBirdsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setCloudsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setColorFilter]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setCoronaReflectionsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setFarClipDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setFogDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setGameSpeed]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setGarageOpen]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setGravity]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setHeatHaze]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setInteriorFurnitureEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setInteriorSoundsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setJetpackMaxHeight]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setMinuteDuration]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setMoonSize]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setNearClipDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setOcclusionsEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setPedsLODDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setPlayerBlurLevel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setRainLevel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setSkyGradient]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setSunColor]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setSunSize]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setTime]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setTrafficLightsLocked]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setTrafficLightState]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setVehiclesLODDistance]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setWeather]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setWeatherBlended]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setWindVelocity]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setWorldSoundEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[[setWorldSpecialPropertyEnabled]]&amp;lt;/li&amp;gt;&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21902|&lt;br /&gt;
&amp;lt;li&amp;gt;[[setGrainLevel]]&amp;lt;/li&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|21902|&lt;br /&gt;
&amp;lt;li&amp;gt;[[setGrainMultiplier]]&amp;lt;/li&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;li&amp;gt;[[testLineAgainstWater]]&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Functions templates]]&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ProcessLineAgainstMesh&amp;diff=77746</id>
		<title>ProcessLineAgainstMesh</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ProcessLineAgainstMesh&amp;diff=77746"/>
		<updated>2023-09-30T16:08:41Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: New feature tag&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{New feature/item|3.0161|1.6.0|22219|Does a raycast against an element's renderable mesh model directly}}&lt;br /&gt;
Does a raycast against an element's renderable mesh model [not the collision model!].&lt;br /&gt;
The same functionality is already present in [[processLineOfSight]], but the latter is a little buggy due to the fact that the collision model is always simplified, and not exactly the same as the mesh, which leads to situations where no hit is detected, even though the visible mesh is hittable [or vice versa].&lt;br /&gt;
Also, when one is interested in a specific element the overhead is a lot smaller [as we can skip all the collision detection done by the before-mentioned function].&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
Return values labelled for ease of reference.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool               -- hit &lt;br /&gt;
float float        -- texU, texV&lt;br /&gt;
string             -- textureName&lt;br /&gt;
string             -- frameName&lt;br /&gt;
float float float  -- worldX, worldY, worldZ&lt;br /&gt;
                  processLineAgainstMesh(element toTest, &lt;br /&gt;
                                         float startX, float startY, float startZ, &lt;br /&gt;
                                         float endX, float endY, float endZ)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''toProcess:''' The element to process the line against&lt;br /&gt;
*'''startX, startY, startZ:''' The start [origin] of the line&lt;br /&gt;
*'''endX, endY, endZ:''' The end of the line&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
*'''hit:''' ''true'' if there is a collision with the given element's mesh, ''false'' otherwise [in which case all other values are nil]&lt;br /&gt;
*'''texU, texV:''' the U, V coordinates on the hit geometry's texture&lt;br /&gt;
*'''textureName:''' name of the hit geometry's texture&lt;br /&gt;
*'''frameName:''' hit frame's name&lt;br /&gt;
*'''worldX, worldY, worldZ:''' collision position in world space&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.6.0-9.22173|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedControlState&amp;diff=77247</id>
		<title>SetPedControlState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedControlState&amp;diff=77247"/>
		<updated>2023-08-03T09:13:00Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Add a note on crouching&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function makes a [[ped]] or [[player]] press or release a certain [[control names|control]].&lt;br /&gt;
{{Note|You can't use enter_exit or enter_passenger on a ped. Please use [[setPedEnterVehicle]] and [[setPedExitVehicle]].}}&lt;br /&gt;
{{Note|To make a ped crouch, set the control to ''true'' and reset to ''false'' after one frame. Use [[setTimer]] with 0ms. Do the same to make the ped stand again.}}&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 setPedControlState ( ped thePed, string control, bool state )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[Ped]]:setControlState}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the ped you want to press or release a control.&lt;br /&gt;
*'''control:''' the name of the control of which to change the state. See [[control names]] for a list of valid names.&lt;br /&gt;
*'''state:''' the new control state. ''true'' means pressed, ''false'' is released.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' if otherwise.&lt;br /&gt;
&lt;br /&gt;
==Remarks==&lt;br /&gt;
If you set the control state on the localPlayer element, then the control state is synchronized to every other client as if the input was made through the game input. But if you set any control states to server-side peds then the control state is not automatically synchronized. This behaviour is unaffected by being the syncer of the server-side ped or not. Let's assume that the syncer client calls setPedControlState on the ped. The other game clients - the ones where setPedControlState was not manually called by scripts - will see the ped teleport around. It will clearly look as if synchronization were broken.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function newPed()&lt;br /&gt;
    local x, y, z = getElementPosition(localPlayer)&lt;br /&gt;
    local ped = createPed(0, x + 1, y, z)&lt;br /&gt;
    if ped then &lt;br /&gt;
        setPedControlState(ped, &amp;quot;forwards&amp;quot;, true)&lt;br /&gt;
    end &lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;ped&amp;quot;, newPed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.5.5-3.11427|Works with the [[getLocalPlayer|local player]] as well. Deprecated [[setControlState]] and [[getControlState]].}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=77246</id>
		<title>SetTimer</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetTimer&amp;diff=77246"/>
		<updated>2023-08-03T09:07:39Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Remove irrelevant version info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}{{Important Note|The speed at which a client side timer runs can be completely unreliable if a client is maliciously modifying their operating system speed, timers could run much faster or slower.}}&lt;br /&gt;
{{Important Note|Writing the following code can cause performance issues. Use [[onClientPreRender]] instead. &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;setTimer(theFunction, 0, 0)&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
This function allows you to trigger a function after a number of milliseconds have elapsed. You can call one of your own functions or a built-in function. For example, you could set a timer to spawn a player after a number of seconds have elapsed.&lt;br /&gt;
&lt;br /&gt;
Once a timer has finished repeating, it no longer exists.&lt;br /&gt;
&lt;br /&gt;
The minimum accepted interval is 0ms.&lt;br /&gt;
&lt;br /&gt;
Multi Theft Auto guarantees that the timer will be triggered after ''at least'' the interval you specify. The resolution of the timer is tied to the frame rate (server side and client-side). All the overdue timers are triggered at a single point each frame. This means that if, for example, the player is running at 30 frames per second, then two timers specified to occur after 100ms and 110ms would more than likely occur during the same frame, as the difference in time between the two timers (10ms) is less than half the length of the frame (33ms). As with most timers provided by other languages, you shouldn't rely on the timer triggering at an exact point in the future. &lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
timer setTimer ( function theFunction, int timeInterval, int timesToExecute [, var arguments... ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[Timer]]}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theFunction:''' The function you wish the timer to call.&lt;br /&gt;
{{Note|The hidden global variable '''sourceTimer''' contains the currently executing timer userdata}}&lt;br /&gt;
{{Note|The hidden global variable '''source''' becomes ''nil'' inside a timer function. You need to declare it on the function arguments if you need to use it.}}&lt;br /&gt;
*'''timeInterval:''' The number of milliseconds that should elapse before the function is called. The minimum is 0 ms; 1000 milliseconds = 1 second)&lt;br /&gt;
*'''timesToExecute:''' The number of times you want the timer to execute, or 0 for infinite repetitions.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''arguments:''' Any arguments you wish to pass to the function can be listed after the ''timesToExecute'' argument. Note that any tables you want to pass will get cloned, whereas metatables and functions/function references in that passed table will get lost. Also changes you make in the original table before the function gets called won't get transferred.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a [[timer]] pointer if the timer was set successfully, ''false'' if the arguments are invalid or the timer could not be set.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will output some text after a small delay.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define function to be called&lt;br /&gt;
function delayedChat ( text )&lt;br /&gt;
	outputChatBox ( &amp;quot;Delayed text: &amp;quot; .. text )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- set a timer so the function is called after 1 second&lt;br /&gt;
setTimer ( delayedChat, 1000, 1, &amp;quot;Hello, World!&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
1 second after the line above has been executed, the text ''Delayed text: Hello, World!'' will be displayed in the chat box.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example will nest a whole function within a timer. This is nice for things like setting variables without having to call a function outside of your code block.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function mainFunction()&lt;br /&gt;
        outputChatBox (&amp;quot;Instant text!&amp;quot;)&lt;br /&gt;
	setTimer ( function()&lt;br /&gt;
		outputChatBox ( &amp;quot;5 second delay text!&amp;quot; )&lt;br /&gt;
	end, 5000, 1 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
mainFunction() --call function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 3&amp;quot; class=&amp;quot;both&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example outputs some random text to the chat every 300000 milliseconds (5 minutes).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setTimer(function()&lt;br /&gt;
    outputChatBox(&amp;quot;Text &amp;quot; .. math.random(1,4))&lt;br /&gt;
end, 300000, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 4&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example should send a global message about the death of a player on a random time. I used [https://wiki.multitheftauto.com/wiki/Math.round math.round] in this example to give a nicer output.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function math.round(number, decimals, method) -- math.round, useful function taken from the wiki: https://wiki.multitheftauto.com/wiki/Math.round&lt;br /&gt;
    decimals = decimals or 0&lt;br /&gt;
    local factor = 10 ^ decimals&lt;br /&gt;
    if (method == &amp;quot;ceil&amp;quot; or method == &amp;quot;floor&amp;quot;) then return math[method](number * factor) / factor&lt;br /&gt;
    else return tonumber((&amp;quot;%.&amp;quot;..decimals..&amp;quot;f&amp;quot;):format(number)) end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function onWasted()&lt;br /&gt;
	local delay = math.random(500, 5000) -- 0.5s to 5s of delay&lt;br /&gt;
	setTimer(function(thePlayer) -- Starts the Timer&lt;br /&gt;
		local whoDied = &amp;quot;Someone&amp;quot; -- In case the name can't be read, Someone will appear&lt;br /&gt;
		if isElement(thePlayer) then -- This checks if thePlayer's element still exists (which means thePlayer hasnt disconnected yet)&lt;br /&gt;
			whoDied = getPlayerName(thePlayer) -- Changes Someone to thePlayer's name&lt;br /&gt;
		end&lt;br /&gt;
		outputChatBox(whoDied..&amp;quot; #FFFFFFhas #FF0000died #FFFFFF&amp;quot;..math.round(delay/1000, 1)..&amp;quot; seconds ago.&amp;quot;, root, 255, 175, 0, true) -- This will output to everyone on the server that thePlayer (or Someone) died X seconds ago.&lt;br /&gt;
	end&lt;br /&gt;
	delay, 1, source) -- The source at the end is an argument for the function we made before, you can't use the source directly because it won't be readed&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerWasted&amp;quot;, root, onWasted) -- Executed every time someone dies&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;
{{Utility functions}}&lt;br /&gt;
[[pt-br:SetTimer]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ClearElementVisibleTo&amp;diff=77245</id>
		<title>ClearElementVisibleTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ClearElementVisibleTo&amp;diff=77245"/>
		<updated>2023-08-03T08:57:33Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function clears any settings added by [[setElementVisibleTo]] and restores an [[element]] to its default [[visibility]].&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 clearElementVisibleTo ( element theElement )   &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:clearVisibility|||}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element in which you wish to restore to its default visibility&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the operation was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example clears any visibility settings after a player dies, so everyone can see his blip for a short period&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- specify the getBlipAttachedTo function&lt;br /&gt;
function getBlipAttachedTo( thePlayer )&lt;br /&gt;
	local blips = getElementsByType( &amp;quot;blip&amp;quot; )&lt;br /&gt;
	for k, theBlip in ipairs( blips ) do&lt;br /&gt;
		if getElementAttachedTo( theBlip ) == thePlayer then&lt;br /&gt;
			return theBlip&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function clearVisibilityWasted ( totalammo, killer, killerweapon, bodypart ) -- when a player dies&lt;br /&gt;
    clearElementVisibleTo ( getBlipAttachedTo ( source ) ) -- clear any visiblity settings of his blip&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWasted&amp;quot;, root, clearVisibilityWasted  ) --add an event handler for onPlayerWasted&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=77244</id>
		<title>SetElementVisibleTo</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementVisibleTo&amp;diff=77244"/>
		<updated>2023-08-03T08:56:23Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Describe precisely which elements this function works with&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Needs_Checking|Can an element only be visible to one element (and its children) at a time? If so, do we need clearElementVisibleTo? If not, surely we need to remove the root element before using this function?&lt;br /&gt;
&lt;br /&gt;
Does the order of setElementVisibleTo calls really not matter? [[visibility|Visibility]] seems to ''imply'' that the order does matter.&lt;br /&gt;
&lt;br /&gt;
Is this function particularly ''or only'' useful for changing the visibility of markers, radar blips and radar areas?|[[User:EAi|EAi]][[User:Iam2noob4u|Iam2noob4u]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This function can change an [[element]]'s [[visibility]].&lt;br /&gt;
&lt;br /&gt;
This function only works with the following elements.&lt;br /&gt;
* [[Marker]]s&lt;br /&gt;
* [[Blip]]s&lt;br /&gt;
* [[Radararea]]s&lt;br /&gt;
&lt;br /&gt;
Visibility settings of lower elements in the element tree override higher ones - if visibility for root is set to false and for a player is set to true, it will be visible to the player.&lt;br /&gt;
&lt;br /&gt;
If you want to clear all visibility settings of an [[element]], try [[clearElementVisibleTo]]&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 setElementVisibleTo ( element theElement, element visibleTo, bool visible )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setVisibleTo||isElementVisibleTo}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The element you want to control the visibility of.&lt;br /&gt;
*'''visibleTo:''' The element you wish the element to be visible or invisible to. Any child elements that are players will also be able to see the element. See [[visibility]].&lt;br /&gt;
*'''visible:''' Whether you are making it visible or invisible to the player.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element's visibility was changed successfully, ''false'' otherwise, for example if you are trying to change the visibility of a vehicle, player or object.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a marker and makes it only visibile to the player called 'someguy'.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	&lt;br /&gt;
	-- Then make the marker invisible to the whole dimension (root for the first)&lt;br /&gt;
	setElementVisibleTo ( myMarker, root, false )&lt;br /&gt;
	-- Set marker visibility to true for someguy&lt;br /&gt;
	setElementVisibleTo ( myMarker, someguy, true )&lt;br /&gt;
	&lt;br /&gt;
	-- The order in which you do the visibility changes does not matter, but ideally trues should be set before falses in order to prevent a momentary flicker.&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following example shows how to make the marker visible to everyone except anotherguy&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- Find the player called someguy&lt;br /&gt;
local someguy = getPlayerFromName ( &amp;quot;someguy&amp;quot; )&lt;br /&gt;
local anotherguy = getPlayerFromName ( &amp;quot;anotherguy&amp;quot; )&lt;br /&gt;
-- If the player was found then&lt;br /&gt;
if ( someguy ) then&lt;br /&gt;
	-- Get the player's position into the variables x, y and z&lt;br /&gt;
	x, y, z = getElementPosition ( someguy )&lt;br /&gt;
	-- Create a marker at the player's position&lt;br /&gt;
	myMarker = createMarker ( x, y, z )&lt;br /&gt;
	attachElements(myMarker, someguy)&lt;br /&gt;
&lt;br /&gt;
	-- First make sure everyone is able to see the marker, this line is unnecessary in this case as root visibility is set to true by default behaviour&lt;br /&gt;
	setElementVisibleTo ( myMarker, root, true )&lt;br /&gt;
&lt;br /&gt;
	-- Then hide it from anotherguy&lt;br /&gt;
	setElementVisibleTo ( myMarker, anotherguy, false )&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Sync_interval_settings&amp;diff=77075</id>
		<title>Sync interval settings</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Sync_interval_settings&amp;diff=77075"/>
		<updated>2023-06-18T08:42:24Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: (1.6) added ped_far_sync_interval&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About player sync==&lt;br /&gt;
Player key sync is always done on demand. i.e. Player presses W, (or pushes forward on the joystick), and the sync for that is sent straight away to the server, and then to the other clients.&lt;br /&gt;
There is no setting to limit key sync as it is an essential component to minimize latency.&lt;br /&gt;
The 'player_sync_interval' below, is the interval between positional and rotational corrections to key sync. This is in case the movement interpreted by the key sync system on remote clients has introduced any errors.&lt;br /&gt;
&lt;br /&gt;
==Default values==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|'''Name'''&lt;br /&gt;
|'''Default (ms)'''&lt;br /&gt;
|'''Valid range'''&lt;br /&gt;
|'''Description'''&lt;br /&gt;
|-&lt;br /&gt;
| player_sync_interval&lt;br /&gt;
| 100&lt;br /&gt;
| 50-4000&lt;br /&gt;
| Time between key sync correction updates for players. (Note: Player key sync is always done on demand and is not affected by any setting) (Note2: Don't set player_sync_interval interval too high, it will cause fake network troubles)&lt;br /&gt;
|-&lt;br /&gt;
| lightweight_sync_interval&lt;br /&gt;
| 1500&lt;br /&gt;
| 50-4000&lt;br /&gt;
| Time between updates for very far away players&lt;br /&gt;
|-&lt;br /&gt;
| camera_sync_interval&lt;br /&gt;
| 500&lt;br /&gt;
| 50-4000&lt;br /&gt;
| How often to tell the server of any client side changes to the local players camera position and target.&lt;br /&gt;
|-&lt;br /&gt;
| ped_sync_interval&lt;br /&gt;
| 400&lt;br /&gt;
| 50-4000&lt;br /&gt;
| Time between updates for non-player peds&lt;br /&gt;
|-&lt;br /&gt;
| ped_far_sync_interval&lt;br /&gt;
| 2000&lt;br /&gt;
| 50-4000&lt;br /&gt;
| Time between updates for non-player peds for clients which are far away from the ped.&lt;br /&gt;
|-&lt;br /&gt;
| unoccupied_vehicle_sync_interval&lt;br /&gt;
| 1000&lt;br /&gt;
| 50-4000&lt;br /&gt;
| Time between updates for unoccupied vehicles&lt;br /&gt;
|-&lt;br /&gt;
| keysync_mouse_sync_interval&lt;br /&gt;
| 100&lt;br /&gt;
| 50-4000&lt;br /&gt;
| Minimum gap between mouse movement updates being sent to the server&lt;br /&gt;
|-&lt;br /&gt;
| keysync_analog_sync_interval&lt;br /&gt;
| 100&lt;br /&gt;
| 50-4000&lt;br /&gt;
| Minimum gap between joystick partial axes movement updates being sent to the server. (Full axes movement is treated as key sync and is not limited by this setting)&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Suggested settings==&lt;br /&gt;
===Bandwith and CPU saver===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| player_sync_interval&lt;br /&gt;
| 200&lt;br /&gt;
|-&lt;br /&gt;
| lightweight_sync_interval&lt;br /&gt;
| 3000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Bandwith and CPU super saver===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| player_sync_interval&lt;br /&gt;
| 300&lt;br /&gt;
|-&lt;br /&gt;
| lightweight_sync_interval&lt;br /&gt;
| 4000&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Less annoying unoccupied vehicles===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| unoccupied_vehicle_sync_interval&lt;br /&gt;
| 500&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Uber sync (bandwidth and CPU intensive)===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| player_sync_interval&lt;br /&gt;
| 50&lt;br /&gt;
|-&lt;br /&gt;
| keysync_mouse_sync_interval&lt;br /&gt;
| 50&lt;br /&gt;
|-&lt;br /&gt;
| keysync_analog_sync_interval&lt;br /&gt;
| 50&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=77074</id>
		<title>Server mtaserver.conf</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=77074"/>
		<updated>2023-06-18T08:33:34Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====servername====&lt;br /&gt;
:''&amp;lt;servername&amp;gt;Default MTA Server&amp;lt;/servername&amp;gt;''&lt;br /&gt;
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter. &lt;br /&gt;
&lt;br /&gt;
====owner_email_address====&lt;br /&gt;
:''&amp;lt;owner_email_address&amp;gt;&amp;lt;/owner_email_address&amp;gt;''&lt;br /&gt;
:This parameter specifies the contact email addresses for the owner(s) of this server. &lt;br /&gt;
:The email addresses will not be publicly available, and only used by MTA administrators to contact the server owner. &lt;br /&gt;
:Note: Missing or incorrect owner_email_address can affect visibility in the master server list. &lt;br /&gt;
:Values: Comma separated list of email addresses&lt;br /&gt;
&lt;br /&gt;
====serverip====&lt;br /&gt;
:''&amp;lt;serverip&amp;gt;auto&amp;lt;/serverip&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - it is generally only needed for complex network topologies and should be left at the default value otherwise.&lt;br /&gt;
: This parameter specifies the public IP address that the server will announce to the MTA servers, for the purposes of registering itself in the master server list and receiving some internal status updates. Usually, setting this parameter is only useful for some specialized scenarios, like servers that can be reached by multiple public addresses, or when a firewall is used for controlling incoming connections. If set to auto, the public IP address the requests originate from will be used as the server IP for communicating with MTA servers, which works fine in most cases.&lt;br /&gt;
:Values: auto or x.x.x.x ; default value: auto&lt;br /&gt;
:SERVERIP SHOULD BE LEFT SET TO auto UNLESS YOU ARE SURE OF WHAT YOU ARE DOING&lt;br /&gt;
:WARNING: SETTING serverip AND THEN ASKING FOR SUPPORT CAN CAUSE DEATH OR INJURY&lt;br /&gt;
&lt;br /&gt;
====serverport====&lt;br /&gt;
:''&amp;lt;serverport&amp;gt;22003&amp;lt;/serverport&amp;gt; &lt;br /&gt;
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;&lt;br /&gt;
:default value: 22003. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====maxplayers====&lt;br /&gt;
:''&amp;lt;maxplayers&amp;gt;32&amp;lt;/maxplayers&amp;gt;&lt;br /&gt;
:This parameter specifies the number of maximum player slots available on the server;&lt;br /&gt;
:default value: 32. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====httpserver====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
:This parameter specifies whether the built-in http server will be used.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpport====&lt;br /&gt;
:''&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as &amp;lt;serverport&amp;gt;. It is a required parameter if &amp;lt;httpserver&amp;gt; is set to 1.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpdownloadurl====&lt;br /&gt;
:''&amp;lt;httpdownloadurl&amp;gt;&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.&lt;br /&gt;
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]&lt;br /&gt;
&lt;br /&gt;
====httpmaxconnectionsperclient====&lt;br /&gt;
:''&amp;lt;httpmaxconnectionsperclient&amp;gt;5&amp;lt;/httpmaxconnectionsperclient&amp;gt;&lt;br /&gt;
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.&lt;br /&gt;
:Available range: 1 to 8.&lt;br /&gt;
&lt;br /&gt;
====httpdosthreshold====&lt;br /&gt;
:''&amp;lt;httpdosthreshold&amp;gt;20&amp;lt;/httpdosthreshold&amp;gt;&lt;br /&gt;
:This parameter limits the number http connections that an IP can initiate over a short period of time.&lt;br /&gt;
:Available range: 1 to 100. default value: 20&lt;br /&gt;
&lt;br /&gt;
====http_dos_exclude====&lt;br /&gt;
:''&amp;lt;http_dos_exclude&amp;gt;&amp;lt;/http_dos_exclude&amp;gt;&lt;br /&gt;
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.&lt;br /&gt;
:e.g. 88.11.22.33,101.2.3.4&lt;br /&gt;
&lt;br /&gt;
====allow_gta3_img_mods====&lt;br /&gt;
:''&amp;lt;allow_gta3_img_mods&amp;gt;none&amp;lt;/allow_gta3_img_mods&amp;gt;&lt;br /&gt;
:By default, the server will block the use of locally customized gta3.img player skins&lt;br /&gt;
:This setting can be used to allow such mods. Not recommended for competitive servers.&lt;br /&gt;
:Values: none, peds ; default value: none&lt;br /&gt;
&lt;br /&gt;
====client_file====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;client_file name=&amp;quot;data/carmods.dat&amp;quot; verify=&amp;quot;0&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:By default, the server will block the use of customized GTA:SA data files.&lt;br /&gt;
:To allow specific client files, add one or more of the above lines.&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cclient_file_name.3D.22data.2Fcarmods.dat.22_verify.3D.220.22.2F.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====disableac====&lt;br /&gt;
:''&amp;lt;disableac&amp;gt;&amp;lt;/disableac&amp;gt;&lt;br /&gt;
:Comma separated list of disabled anti-cheats.&lt;br /&gt;
:e.g. To disable anti-cheat #2 and #3, use: 2,3&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cdisableac.3E.3C.2Fdisableac.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====enablesd====&lt;br /&gt;
:''&amp;lt;enablesd&amp;gt;31,32&amp;lt;/enablesd&amp;gt;&lt;br /&gt;
:Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. &lt;br /&gt;
:Competitive servers may wish to enable certain special detections, but most servers should leave this setting on its default.&lt;br /&gt;
:Values: special detection (SD) codes ; default value: 31,32 (e.g. enables special detections #31 and #32)&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====minclientversion====&lt;br /&gt;
:''&amp;lt;minclientversion&amp;gt;&amp;lt;/minclientversion&amp;gt;&lt;br /&gt;
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.1.0-9.03100.0&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====minclientversion_auto_update====&lt;br /&gt;
:''&amp;lt;minclientversion_auto_update&amp;gt;1&amp;lt;/minclientversion_auto_update&amp;gt;&lt;br /&gt;
:This parameter specifies if/when the &amp;lt;minclientversion&amp;gt; setting is automatically updated.&lt;br /&gt;
:Keeping &amp;lt;minclientversion&amp;gt; updated can help reduce cheating.&lt;br /&gt;
:Note: The instant setting (2) is only recommended for competitive servers.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.&lt;br /&gt;
&lt;br /&gt;
====recommendedclientversion====&lt;br /&gt;
:''&amp;lt;recommendedclientversion&amp;gt;&amp;lt;/recommendedclientversion&amp;gt;&lt;br /&gt;
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====ase====&lt;br /&gt;
:''&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt;&lt;br /&gt;
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the in-game server browser. An additional UDP port needs to be available for this to work (value from &amp;lt;serverport&amp;gt; + 123 , so on a default &amp;lt;serverport&amp;gt; value 22003 the right port will be 22126 ).&lt;br /&gt;
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====donotbroadcastlan====&lt;br /&gt;
:''&amp;lt;donotbroadcastlan&amp;gt;0&amp;lt;/donotbroadcastlan&amp;gt;&lt;br /&gt;
:This parameter allows you to disable LAN broadcasting.	&lt;br /&gt;
&lt;br /&gt;
====password====&lt;br /&gt;
:''&amp;lt;password&amp;gt;&amp;lt;/password&amp;gt; &lt;br /&gt;
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====bandwidth_reduction====&lt;br /&gt;
:''&amp;lt;bandwidth_reduction&amp;gt;medium&amp;lt;/bandwidth_reduction&amp;gt; &lt;br /&gt;
:This parameter reduces the server's bandwidth usage by using various optimizations.&lt;br /&gt;
:Values: none, medium or maximum ; default value: medium&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_syncer_distance&amp;gt;130&amp;lt;/unoccupied_vehicle_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced unoccupied vehicles&lt;br /&gt;
:Available range: 50 - 400; default value: 130&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====ped_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;ped_syncer_distance&amp;gt;100&amp;lt;/ped_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced peds&lt;br /&gt;
:Available range: 50 - 400; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====player_sync_interval====&lt;br /&gt;
:''&amp;lt;player_sync_interval&amp;gt;100&amp;lt;/player_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between player sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====lightweight_sync_interval====&lt;br /&gt;
:''&amp;lt;lightweight_sync_interval&amp;gt;1500&amp;lt;/lightweight_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between lightweight (player) sync packets.&lt;br /&gt;
:Available range: 200 - 4000; default value: 1500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====camera_sync_interval====&lt;br /&gt;
:''&amp;lt;camera_sync_interval&amp;gt;500&amp;lt;/camera_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between camera sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_sync_interval&amp;gt;500&amp;lt;/ped_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is near the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_far_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_far_sync_interval&amp;gt;2000&amp;lt;/ped_far_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is far away from the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 2000&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_sync_interval====&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_sync_interval&amp;gt;400&amp;lt;/unoccupied_vehicle_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 400&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_mouse_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_mouse_sync_interval&amp;gt;100&amp;lt;/keysync_mouse_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_analog_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_analog_sync_interval&amp;gt;100&amp;lt;/keysync_analog_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====bullet_sync====&lt;br /&gt;
:''&amp;lt;bullet_sync&amp;gt;1&amp;lt;/bullet_sync&amp;gt;   &lt;br /&gt;
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.&lt;br /&gt;
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====vehext_percent====&lt;br /&gt;
:''&amp;lt;vehext_percent&amp;gt;0&amp;lt;/vehext_percent&amp;gt;&lt;br /&gt;
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. &lt;br /&gt;
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.&lt;br /&gt;
:Depending on the gamemode, an incorrect prediction may have a negative effect. &lt;br /&gt;
:Therefore this setting should be considered experimental.&lt;br /&gt;
:Available range: 0 to 100.  Default - 0&lt;br /&gt;
&lt;br /&gt;
====vehext_ping_limit====&lt;br /&gt;
:''&amp;lt;vehext_ping_limit&amp;gt;150&amp;lt;/vehext_ping_limit&amp;gt;&lt;br /&gt;
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.&lt;br /&gt;
:Only relevant if &amp;lt;vehext_percent&amp;gt; is greater than zero.&lt;br /&gt;
:Available range: 50 to 500.  Default - 150&lt;br /&gt;
&lt;br /&gt;
====latency_reduction====&lt;br /&gt;
:''&amp;lt;latency_reduction&amp;gt;0&amp;lt;/latency_reduction&amp;gt;&lt;br /&gt;
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).&lt;br /&gt;
:Due to the impact this may have on shot lag compensation, it should be considered experimental.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
:Bugs caused by enabling latency_reduction: https://bugs.mtasa.com/view.php?id=8191 + https://bugs.mtasa.com/view.php?id=8226&lt;br /&gt;
&lt;br /&gt;
====threadnet====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;threadnet&amp;gt;1&amp;lt;/threadnet&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to run the network synchronization on another thread.&lt;br /&gt;
:Enabling will make the sync smoother, but may increase CPU usage slightly.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====idfile====&lt;br /&gt;
:''&amp;lt;idfile&amp;gt;server-id.keys&amp;lt;/idfile&amp;gt; &lt;br /&gt;
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. &lt;br /&gt;
:Keep a backup of this file in a safe place. Default value: server-id.keys&lt;br /&gt;
:More information about client private files: [[Filepath]]&lt;br /&gt;
&lt;br /&gt;
====logfile====&lt;br /&gt;
:''&amp;lt;logfile&amp;gt;logs/server.log&amp;lt;/logfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====authfile====&lt;br /&gt;
:''&amp;lt;authfile&amp;gt;logs/server_auth.log&amp;lt;/authfile&amp;gt;&lt;br /&gt;
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used&lt;br /&gt;
&lt;br /&gt;
====dbfile====&lt;br /&gt;
:''&amp;lt;dbfile&amp;gt;logs/db.log&amp;lt;/dbfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.&lt;br /&gt;
&lt;br /&gt;
====loadstringfile====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;loadstringfile&amp;gt;logs/loadstring.log&amp;lt;/loadstringfile&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.&lt;br /&gt;
&lt;br /&gt;
====acl====&lt;br /&gt;
:''&amp;lt;acl&amp;gt;acl.xml&amp;lt;/acl&amp;gt; &lt;br /&gt;
:This parameter specifies the location and name of the Access Control List settings file. If left&lt;br /&gt;
:blank, server will use acl.xml file, located in the same folder as this configuration file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebuglogfile====&lt;br /&gt;
:''&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebugloglevel====&lt;br /&gt;
:''&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====htmldebuglevel====&lt;br /&gt;
:''&amp;lt;htmldebuglevel&amp;gt;0&amp;lt;/htmldebuglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====filter_duplicate_log_lines====&lt;br /&gt;
:''&amp;lt;filter_duplicate_log_lines&amp;gt;1&amp;lt;/filter_duplicate_log_lines&amp;gt;&lt;br /&gt;
:Specifies whether or not duplicate log lines should be filtered. Available values: 0 or 1, defaults to 1.&lt;br /&gt;
&lt;br /&gt;
====fpslimit====&lt;br /&gt;
:''&amp;lt;fpslimit&amp;gt;36&amp;lt;/fpslimit&amp;gt;&lt;br /&gt;
:Specifies the frame rate limit that will be applied to connecting clients.&lt;br /&gt;
:Available range: 25 to 100. Default: 36.&lt;br /&gt;
:When running the map editor locally (i.e. from the client), the default FPS limit is 50.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====voice====&lt;br /&gt;
:''&amp;lt;voice&amp;gt;0&amp;lt;/voice&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to enable player voice chat in-game&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled&lt;br /&gt;
&lt;br /&gt;
====voice_samplerate====&lt;br /&gt;
:''&amp;lt;voice_samplerate&amp;gt;1&amp;lt;/voice_samplerate&amp;gt;&lt;br /&gt;
:This parameter specifies the sample rate for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat&lt;br /&gt;
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz).  Default - 1&lt;br /&gt;
&lt;br /&gt;
====voice_quality====&lt;br /&gt;
:''&amp;lt;voice_quality&amp;gt;4&amp;lt;/voice_quality&amp;gt;&lt;br /&gt;
:This parameter specifies the voice quality for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat&lt;br /&gt;
:Available range: 0 to 10.  Default - 4&lt;br /&gt;
&lt;br /&gt;
====voice_bitrate====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;voice_bitrate&amp;gt;24600&amp;lt;/voice_bitrate&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically.  Use with care.&lt;br /&gt;
&lt;br /&gt;
====backup_path====&lt;br /&gt;
:''&amp;lt;backup_path&amp;gt;backups&amp;lt;/backup_path&amp;gt;&lt;br /&gt;
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups&lt;br /&gt;
&lt;br /&gt;
====backup_interval====&lt;br /&gt;
:''&amp;lt;backup_interval&amp;gt;3&amp;lt;/backup_interval&amp;gt;&lt;br /&gt;
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 30.  Default - 3&lt;br /&gt;
&lt;br /&gt;
====backup_copies====&lt;br /&gt;
:''&amp;lt;backup_copies&amp;gt;10&amp;lt;/backup_copies&amp;gt;&lt;br /&gt;
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 100.  Default - 10&lt;br /&gt;
&lt;br /&gt;
====compact_internal_databases====&lt;br /&gt;
:''&amp;lt;compact_internal_databases&amp;gt;1&amp;lt;/compact_internal_databases&amp;gt;&lt;br /&gt;
:This parameter specifies when the internal sqlite databases should be defragmented.&lt;br /&gt;
:For more info see: https://www.sqlite.org/lang_vacuum.html&lt;br /&gt;
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====crash_dump_upload====&lt;br /&gt;
:''&amp;lt;crash_dump_upload&amp;gt;1&amp;lt;/crash_dump_upload&amp;gt;&lt;br /&gt;
:This parameter specifies whether server crash dump files should be sent to MTA HQ.&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 1&lt;br /&gt;
&lt;br /&gt;
====fakelag====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;fakelag&amp;gt;0&amp;lt;/fakelag&amp;gt;&lt;br /&gt;
:This parameter specifies whether the [[Command fakelag|fakelag and sfakelag]] commands are enabled&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 0&lt;br /&gt;
&lt;br /&gt;
====auth_serial_groups====&lt;br /&gt;
:''&amp;lt;auth_serial_groups&amp;gt;Admin&amp;lt;/auth_serial_groups&amp;gt;&lt;br /&gt;
:This parameter lists the ACL groups that are protected by serial authorization.&lt;br /&gt;
:Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command.&lt;br /&gt;
:For more info see: https://mtasa.com/authserial&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list.&lt;br /&gt;
:Values: Comma separated list of ACL groups.  Default - Admin&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http====&lt;br /&gt;
:''&amp;lt;auth_serial_http&amp;gt;1&amp;lt;/auth_serial_http&amp;gt;&lt;br /&gt;
:This parameter specifies if the authorized serial login checks should also apply to the http interface.&lt;br /&gt;
:Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game.&lt;br /&gt;
:For more info see: https://mtasa.com/authserialhttp&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http_ip_exceptions====&lt;br /&gt;
:''&amp;lt;auth_serial_http_ip_exceptions&amp;gt;127.0.0.1&amp;lt;/auth_serial_http_ip_exceptions&amp;gt;&lt;br /&gt;
:This parameter specifies which IP addresses should always pass auth_serial_http checks.&lt;br /&gt;
:Values: Comma separated list of IP addresses&lt;br /&gt;
&lt;br /&gt;
====database_credentials_protection====&lt;br /&gt;
:''&amp;lt;database_credentials_protection&amp;gt;1&amp;lt;/database_credentials_protection&amp;gt;&lt;br /&gt;
:This parameter specifies if extra security measures are applied to resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:The extra measures are:&lt;br /&gt;
: - script files cannot be accessed with [[fileOpen]]&lt;br /&gt;
: - [[meta.xml]] is read-only&lt;br /&gt;
:'''NOTE:''' This only protects resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====module====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_win32.dll&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_linux.so&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the module(s) which are loaded with the server. To load several modules, add more &amp;lt;module&amp;gt; parameter(s). Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====resource====&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;admin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;defaultstats&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;helpmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;joinquit&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapcycler&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;parachute&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcebrowser&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; default=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;scoreboard&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;spawnmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;voice&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;votemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;webadmin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;play&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src-&amp;quot;resources&amp;quot; startup&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&lt;br /&gt;
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more &amp;lt;resource&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
:In addition, there are several flags which control how the server deals with each resource:&lt;br /&gt;
&lt;br /&gt;
:* '''src''': the resource name. This is the only mandatory flag.&lt;br /&gt;
:* '''startup''': controls whether the resource will be started with the server or not. If &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will be started. If not specified, defaults to not starting the resource.&lt;br /&gt;
:* '''protected''': if &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.&lt;br /&gt;
:* '''default''': if given a &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot; value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.&lt;br /&gt;
&lt;br /&gt;
==Deprecated settings==&lt;br /&gt;
&lt;br /&gt;
The following settings have been deprecated in the production version of MTA:SA and no longer work.&lt;br /&gt;
&lt;br /&gt;
====networkencryption====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - also seems to be deprecated in code --&amp;gt;&lt;br /&gt;
:''&amp;lt;networkencryption&amp;gt;1&amp;lt;/networkencryption&amp;gt;&lt;br /&gt;
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====autologin====&lt;br /&gt;
&amp;lt;!-- removed from MTA:SA at https://github.com/multitheftauto/mtasa-blue/commit/e392c417da03b295c7f8342a7f6c1467d094db12#diff-b828bcbfff7135920f9a1179be3e3617 --&amp;gt;&lt;br /&gt;
:''&amp;lt;autologin&amp;gt;0&amp;lt;/autologin&amp;gt;&lt;br /&gt;
:Specifies whether or not players should automatically be logged in based on their IP adresses.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
&lt;br /&gt;
[[Category: Support]]&lt;br /&gt;
[[ru:Server mtaserver.conf]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=77073</id>
		<title>Server mtaserver.conf</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Server_mtaserver.conf&amp;diff=77073"/>
		<updated>2023-06-18T08:31:57Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: (1.6) added ped_far_sync_interval&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page lists the settings that can be set in the settings file. ''Setting from the default '''mtaserver.conf''' settings file is in italics''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====servername====&lt;br /&gt;
:''&amp;lt;servername&amp;gt;Default MTA Server&amp;lt;/servername&amp;gt;''&lt;br /&gt;
:This parameter specifies the name the server will be visible as in the ingame server browser and on Game-Monitor. It is a required parameter. &lt;br /&gt;
&lt;br /&gt;
====owner_email_address====&lt;br /&gt;
:''&amp;lt;owner_email_address&amp;gt;&amp;lt;/owner_email_address&amp;gt;''&lt;br /&gt;
:This parameter specifies the contact email addresses for the owner(s) of this server. &lt;br /&gt;
:The email addresses will not be publicly available, and only used by MTA administrators to contact the server owner. &lt;br /&gt;
:Note: Missing or incorrect owner_email_address can affect visibility in the master server list. &lt;br /&gt;
:Values: Comma separated list of email addresses&lt;br /&gt;
&lt;br /&gt;
====serverip====&lt;br /&gt;
:''&amp;lt;serverip&amp;gt;auto&amp;lt;/serverip&amp;gt;&lt;br /&gt;
:'''ONLY USE THIS PARAMETER IF YOU ARE SURE OF WHAT YOU ARE DOING''' - it is generally only needed for complex network topologies and should be left at the default value otherwise.&lt;br /&gt;
: This parameter specifies the public IP address that the server will announce to the MTA servers, for the purposes of registering itself in the master server list and receiving some internal status updates. Usually, setting this parameter is only useful for some specialized scenarios, like servers that can be reached by multiple public addresses, or when a firewall is used for controlling incoming connections. If set to auto, the public IP address the requests originate from will be used as the server IP for communicating with MTA servers, which works fine in most cases.&lt;br /&gt;
:Values: auto or x.x.x.x ; default value: auto&lt;br /&gt;
:SERVERIP SHOULD BE LEFT SET TO auto UNLESS YOU ARE SURE OF WHAT YOU ARE DOING&lt;br /&gt;
:WARNING: SETTING serverip AND THEN ASKING FOR SUPPORT CAN CAUSE DEATH OR INJURY&lt;br /&gt;
&lt;br /&gt;
====serverport====&lt;br /&gt;
:''&amp;lt;serverport&amp;gt;22003&amp;lt;/serverport&amp;gt; &lt;br /&gt;
:This parameter specifies the UDP port on which the server will be accepting incoming player connections;&lt;br /&gt;
:default value: 22003. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====maxplayers====&lt;br /&gt;
:''&amp;lt;maxplayers&amp;gt;32&amp;lt;/maxplayers&amp;gt;&lt;br /&gt;
:This parameter specifies the number of maximum player slots available on the server;&lt;br /&gt;
:default value: 32. It is a required parameter.&lt;br /&gt;
&lt;br /&gt;
====httpserver====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;httpserver&amp;gt;1&amp;lt;/httpserver&amp;gt;&lt;br /&gt;
:This parameter specifies whether the built-in http server will be used.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpport====&lt;br /&gt;
:''&amp;lt;httpport&amp;gt;22005&amp;lt;/httpport&amp;gt;&lt;br /&gt;
:This parameter specifies the TCP port on which the server will be accepting incoming http connections. It can be set to the same value as &amp;lt;serverport&amp;gt;. It is a required parameter if &amp;lt;httpserver&amp;gt; is set to 1.&lt;br /&gt;
:More information: [[Server_Manual#Using_the_web_interface|Using the web interface]]&lt;br /&gt;
&lt;br /&gt;
====httpdownloadurl====&lt;br /&gt;
:''&amp;lt;httpdownloadurl&amp;gt;&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
:If set, this parameter specifies the external URL from which clients will be able to download needed resources ingame. Otherwise they will download them directly from the server.&lt;br /&gt;
:More information: [[Server_Manual#Configuring_an_external_web_server|Configuring an external web server]]&lt;br /&gt;
&lt;br /&gt;
====httpmaxconnectionsperclient====&lt;br /&gt;
:''&amp;lt;httpmaxconnectionsperclient&amp;gt;5&amp;lt;/httpmaxconnectionsperclient&amp;gt;&lt;br /&gt;
:This parameter limits the number of http connections each client can make. Depending on the type of http server that is used, a lower figure may reduce download timeouts. Only relevant when using an external http server.&lt;br /&gt;
:Available range: 1 to 8.&lt;br /&gt;
&lt;br /&gt;
====httpdosthreshold====&lt;br /&gt;
:''&amp;lt;httpdosthreshold&amp;gt;20&amp;lt;/httpdosthreshold&amp;gt;&lt;br /&gt;
:This parameter limits the number http connections that an IP can initiate over a short period of time.&lt;br /&gt;
:Available range: 1 to 100. default value: 20&lt;br /&gt;
&lt;br /&gt;
====http_dos_exclude====&lt;br /&gt;
:''&amp;lt;http_dos_exclude&amp;gt;&amp;lt;/http_dos_exclude&amp;gt;&lt;br /&gt;
:This parameter lists the IP addresses that are to be excluded from http dos threshold limits.&lt;br /&gt;
:e.g. 88.11.22.33,101.2.3.4&lt;br /&gt;
&lt;br /&gt;
====allow_gta3_img_mods====&lt;br /&gt;
:''&amp;lt;allow_gta3_img_mods&amp;gt;none&amp;lt;/allow_gta3_img_mods&amp;gt;&lt;br /&gt;
:By default, the server will block the use of locally customized gta3.img player skins&lt;br /&gt;
:This setting can be used to allow such mods. Not recommended for competitive servers.&lt;br /&gt;
:Values: none, peds ; default value: none&lt;br /&gt;
&lt;br /&gt;
====client_file====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;client_file name=&amp;quot;data/carmods.dat&amp;quot; verify=&amp;quot;0&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:By default, the server will block the use of customized GTA:SA data files.&lt;br /&gt;
:To allow specific client files, add one or more of the above lines.&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cclient_file_name.3D.22data.2Fcarmods.dat.22_verify.3D.220.22.2F.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====disableac====&lt;br /&gt;
:''&amp;lt;disableac&amp;gt;&amp;lt;/disableac&amp;gt;&lt;br /&gt;
:Comma separated list of disabled anti-cheats.&lt;br /&gt;
:e.g. To disable anti-cheat #2 and #3, use: 2,3&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cdisableac.3E.3C.2Fdisableac.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====enablesd====&lt;br /&gt;
:''&amp;lt;enablesd&amp;gt;31,32&amp;lt;/enablesd&amp;gt;&lt;br /&gt;
:Comma separated list of enabled special detections. A special detection is a type of anti-cheat for (usually) harmless game modifications. &lt;br /&gt;
:Competitive servers may wish to enable certain special detections, but most servers should leave this setting on its default.&lt;br /&gt;
:Values: special detection (SD) codes ; default value: 31,32 (e.g. enables special detections #31 and #32)&lt;br /&gt;
:More information: [[Anti-cheat_guide#.3Cenablesd.3E.3C.2Fenablesd.3E|Anti-cheat guide]]&lt;br /&gt;
&lt;br /&gt;
====minclientversion====&lt;br /&gt;
:''&amp;lt;minclientversion&amp;gt;&amp;lt;/minclientversion&amp;gt;&lt;br /&gt;
:Minimum client version. Clients with a lower version will not be allowed to connect. After disconnection, clients will be given an opportunity to download an update. If left blank, this setting is disabled and there are no restrictions on who can connect. Version numbers are described in [[getPlayerVersion]] and look like this: 1.1.0-9.03100.0&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====minclientversion_auto_update====&lt;br /&gt;
:''&amp;lt;minclientversion_auto_update&amp;gt;1&amp;lt;/minclientversion_auto_update&amp;gt;&lt;br /&gt;
:This parameter specifies if/when the &amp;lt;minclientversion&amp;gt; setting is automatically updated.&lt;br /&gt;
:Keeping &amp;lt;minclientversion&amp;gt; updated can help reduce cheating.&lt;br /&gt;
:Note: The instant setting (2) is only recommended for competitive servers.&lt;br /&gt;
:Values: 0 - disabled, 1 - enabled (delayed by a few days), 2 - enabled (instant) ; default value: 1.&lt;br /&gt;
&lt;br /&gt;
====recommendedclientversion====&lt;br /&gt;
:''&amp;lt;recommendedclientversion&amp;gt;&amp;lt;/recommendedclientversion&amp;gt;&lt;br /&gt;
:Recommended client version. When connecting, if clients have a lower version, they will be given the option to download an update. If left blank, this setting is disabled.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:'''Note that this setting only determines if the client should be prompted to update. The actual build number they receive will be the [[https://nightly.mtasa.com/ver highest available]].'''&lt;br /&gt;
&lt;br /&gt;
====ase====&lt;br /&gt;
:''&amp;lt;ase&amp;gt;1&amp;lt;/ase&amp;gt;&lt;br /&gt;
:This parameter can be used to make the server report to Game-Monitor master servers, allowing it to be visible in the in-game server browser. An additional UDP port needs to be available for this to work (value from &amp;lt;serverport&amp;gt; + 123 , so on a default &amp;lt;serverport&amp;gt; value 22003 the right port will be 22126 ).&lt;br /&gt;
:Available values: 0 - disabled , 1 - enabled. Optional parameter, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====donotbroadcastlan====&lt;br /&gt;
:''&amp;lt;donotbroadcastlan&amp;gt;0&amp;lt;/donotbroadcastlan&amp;gt;&lt;br /&gt;
:This parameter allows you to disable LAN broadcasting.	&lt;br /&gt;
&lt;br /&gt;
====password====&lt;br /&gt;
:''&amp;lt;password&amp;gt;&amp;lt;/password&amp;gt; &lt;br /&gt;
:If set, players will have to provide a password specified below, before they can connect to the server. If left blank, server doesn't require a password from them.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerPassword]] or [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====bandwidth_reduction====&lt;br /&gt;
:''&amp;lt;bandwidth_reduction&amp;gt;medium&amp;lt;/bandwidth_reduction&amp;gt; &lt;br /&gt;
:This parameter reduces the server's bandwidth usage by using various optimizations.&lt;br /&gt;
:Values: none, medium or maximum ; default value: medium&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_syncer_distance&amp;gt;130&amp;lt;/unoccupied_vehicle_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced unoccupied vehicles&lt;br /&gt;
:Available range: 50 - 400; default value: 130&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====ped_syncer_distance====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;ped_syncer_distance&amp;gt;100&amp;lt;/ped_syncer_distance&amp;gt;&lt;br /&gt;
:This parameter determines the distance limit for remote synced peds&lt;br /&gt;
:Available range: 50 - 400; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====player_sync_interval====&lt;br /&gt;
:''&amp;lt;player_sync_interval&amp;gt;100&amp;lt;/player_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between player sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====lightweight_sync_interval====&lt;br /&gt;
:''&amp;lt;lightweight_sync_interval&amp;gt;1500&amp;lt;/lightweight_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between lightweight (player) sync packets.&lt;br /&gt;
:Available range: 200 - 4000; default value: 1500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====camera_sync_interval====&lt;br /&gt;
:''&amp;lt;camera_sync_interval&amp;gt;500&amp;lt;/camera_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between camera sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_sync_interval&amp;gt;500&amp;lt;/ped_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the player is nearby.&lt;br /&gt;
:Available range: 50 - 4000; default value: 500&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====ped_far_sync_interval====&lt;br /&gt;
:''&amp;lt;ped_far_sync_interval&amp;gt;2000&amp;lt;/ped_far_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between ped sync packets when the ped is far away from the player.&lt;br /&gt;
:Available range: 50 - 4000; default value: 2000&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====unoccupied_vehicle_sync_interval====&lt;br /&gt;
:''&amp;lt;unoccupied_vehicle_sync_interval&amp;gt;400&amp;lt;/unoccupied_vehicle_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the time in milliseconds between unoccupied vehicle sync packets.&lt;br /&gt;
:Available range: 50 - 4000; default value: 400&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_mouse_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_mouse_sync_interval&amp;gt;100&amp;lt;/keysync_mouse_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to mouse movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====keysync_analog_sync_interval====&lt;br /&gt;
:''&amp;lt;keysync_analog_sync_interval&amp;gt;100&amp;lt;/keysync_analog_sync_interval&amp;gt; &lt;br /&gt;
:This parameter determines the minimum time in milliseconds between key sync packets due to joystick movement.&lt;br /&gt;
:Available range: 50 - 4000; default value: 100&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
:Suggested values for this and the other sync_interval settings can be found here: [[Sync_interval_settings|Sync interval settings]]&lt;br /&gt;
&lt;br /&gt;
====bullet_sync====&lt;br /&gt;
:''&amp;lt;bullet_sync&amp;gt;1&amp;lt;/bullet_sync&amp;gt;   &lt;br /&gt;
:This parameter can improve the reliability of shots when using certain weapons. However, it uses more bandwidth.&lt;br /&gt;
:Note that bullet sync will be active regardless of this setting when certain [[setGlitchEnabled|glitches]] are enabled.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====vehext_percent====&lt;br /&gt;
:''&amp;lt;vehext_percent&amp;gt;0&amp;lt;/vehext_percent&amp;gt;&lt;br /&gt;
:This parameter sets the amount of extrapolation that clients will apply to remote vehicles. &lt;br /&gt;
:This can reduce some of the latency induced location disparency by predicting where the remote vehicles will probably be.&lt;br /&gt;
:Depending on the gamemode, an incorrect prediction may have a negative effect. &lt;br /&gt;
:Therefore this setting should be considered experimental.&lt;br /&gt;
:Available range: 0 to 100.  Default - 0&lt;br /&gt;
&lt;br /&gt;
====vehext_ping_limit====&lt;br /&gt;
:''&amp;lt;vehext_ping_limit&amp;gt;150&amp;lt;/vehext_ping_limit&amp;gt;&lt;br /&gt;
:This parameter places a limit on how much time (in milliseconds) the vehicle extrapolation will attempt to compensate for.&lt;br /&gt;
:Only relevant if &amp;lt;vehext_percent&amp;gt; is greater than zero.&lt;br /&gt;
:Available range: 50 to 500.  Default - 150&lt;br /&gt;
&lt;br /&gt;
====latency_reduction====&lt;br /&gt;
:''&amp;lt;latency_reduction&amp;gt;0&amp;lt;/latency_reduction&amp;gt;&lt;br /&gt;
:This parameter can reduce the delay of player actions appearing on remote clients by 2 frames (approx 50ms).&lt;br /&gt;
:Due to the impact this may have on shot lag compensation, it should be considered experimental.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
:Bugs caused by enabling latency_reduction: https://bugs.mtasa.com/view.php?id=8191 + https://bugs.mtasa.com/view.php?id=8226&lt;br /&gt;
&lt;br /&gt;
====threadnet====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;threadnet&amp;gt;1&amp;lt;/threadnet&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to run the network synchronization on another thread.&lt;br /&gt;
:Enabling will make the sync smoother, but may increase CPU usage slightly.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====idfile====&lt;br /&gt;
:''&amp;lt;idfile&amp;gt;server-id.keys&amp;lt;/idfile&amp;gt; &lt;br /&gt;
:Specifies the location and file name of this servers unique private key. This is used to prevent private files saved on the client from being read by other servers. &lt;br /&gt;
:Keep a backup of this file in a safe place. Default value: server-id.keys&lt;br /&gt;
:More information about client private files: [[Filepath]]&lt;br /&gt;
&lt;br /&gt;
====logfile====&lt;br /&gt;
:''&amp;lt;logfile&amp;gt;logs/server.log&amp;lt;/logfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the main server log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====authfile====&lt;br /&gt;
:''&amp;lt;authfile&amp;gt;logs/server_auth.log&amp;lt;/authfile&amp;gt;&lt;br /&gt;
:As well as the main log file, login successes and failures are logged here for easy reviewing of security issues. If left blank, this file is not used&lt;br /&gt;
&lt;br /&gt;
====dbfile====&lt;br /&gt;
:''&amp;lt;dbfile&amp;gt;logs/db.log&amp;lt;/dbfile&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log database queries. The server command [[Server_Commands#debugdb|debugdb]] sets the amount of logging.&lt;br /&gt;
&lt;br /&gt;
====loadstringfile====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;loadstringfile&amp;gt;logs/loadstring.log&amp;lt;/loadstringfile&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the location and name of the file used to log loadstring function calls. If left blank or not set, no logging is done.&lt;br /&gt;
&lt;br /&gt;
====acl====&lt;br /&gt;
:''&amp;lt;acl&amp;gt;acl.xml&amp;lt;/acl&amp;gt; &lt;br /&gt;
:This parameter specifies the location and name of the Access Control List settings file. If left&lt;br /&gt;
:blank, server will use acl.xml file, located in the same folder as this configuration file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebuglogfile====&lt;br /&gt;
:''&amp;lt;scriptdebuglogfile&amp;gt;logs/scripts.log&amp;lt;/scriptdebuglogfile&amp;gt; &lt;br /&gt;
:Specifies the location and name of the debugscript log file. If left blank, server won't be saving this file.&lt;br /&gt;
&lt;br /&gt;
====scriptdebugloglevel====&lt;br /&gt;
:''&amp;lt;scriptdebugloglevel&amp;gt;0&amp;lt;/scriptdebugloglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the debugscript log file. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====htmldebuglevel====&lt;br /&gt;
:''&amp;lt;htmldebuglevel&amp;gt;0&amp;lt;/htmldebuglevel&amp;gt;&lt;br /&gt;
:Specifies the level of the html debug. Available values: 0, 1, 2, 3. When not set, defaults to 0.&lt;br /&gt;
&lt;br /&gt;
====filter_duplicate_log_lines====&lt;br /&gt;
:''&amp;lt;filter_duplicate_log_lines&amp;gt;1&amp;lt;/filter_duplicate_log_lines&amp;gt;&lt;br /&gt;
:Specifies whether or not duplicate log lines should be filtered. Available values: 0 or 1, defaults to 1.&lt;br /&gt;
&lt;br /&gt;
====fpslimit====&lt;br /&gt;
:''&amp;lt;fpslimit&amp;gt;36&amp;lt;/fpslimit&amp;gt;&lt;br /&gt;
:Specifies the frame rate limit that will be applied to connecting clients.&lt;br /&gt;
:Available range: 25 to 100. Default: 36.&lt;br /&gt;
:When running the map editor locally (i.e. from the client), the default FPS limit is 50.&lt;br /&gt;
:This parameter can be changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====voice====&lt;br /&gt;
:''&amp;lt;voice&amp;gt;0&amp;lt;/voice&amp;gt;&lt;br /&gt;
:This parameter specifies whether or not to enable player voice chat in-game&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled&lt;br /&gt;
&lt;br /&gt;
====voice_samplerate====&lt;br /&gt;
:''&amp;lt;voice_samplerate&amp;gt;1&amp;lt;/voice_samplerate&amp;gt;&lt;br /&gt;
:This parameter specifies the sample rate for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the sampling quality of voice chat&lt;br /&gt;
:Values: 0 - Narrowband (8kHz), 1 - Wideband (16kHz), 2 - Ultrawideband (32kHz).  Default - 1&lt;br /&gt;
&lt;br /&gt;
====voice_quality====&lt;br /&gt;
:''&amp;lt;voice_quality&amp;gt;4&amp;lt;/voice_quality&amp;gt;&lt;br /&gt;
:This parameter specifies the voice quality for voice chat.  'voice' parameter must be set to 1 for this to be effective. Higher settings use more bandwidth and increase the the overall quality of voice chat&lt;br /&gt;
:Available range: 0 to 10.  Default - 4&lt;br /&gt;
&lt;br /&gt;
====voice_bitrate====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;voice_bitrate&amp;gt;24600&amp;lt;/voice_bitrate&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the voice bitrate, in bps. This optional parameter overrides the previous two settings. If not set, MTA handles this automatically.  Use with care.&lt;br /&gt;
&lt;br /&gt;
====backup_path====&lt;br /&gt;
:''&amp;lt;backup_path&amp;gt;backups&amp;lt;/backup_path&amp;gt;&lt;br /&gt;
:This parameter specifies the path to use for a basic backup of some server files. Note that basic backups are only made during server startup. Default value: backups&lt;br /&gt;
&lt;br /&gt;
====backup_interval====&lt;br /&gt;
:''&amp;lt;backup_interval&amp;gt;3&amp;lt;/backup_interval&amp;gt;&lt;br /&gt;
:This parameter specifies the number of days between each basic backup. Backups are only made during server startup, so the actual interval maybe much longer. Setting backup_interval to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 30.  Default - 3&lt;br /&gt;
&lt;br /&gt;
====backup_copies====&lt;br /&gt;
:''&amp;lt;backup_copies&amp;gt;10&amp;lt;/backup_copies&amp;gt;&lt;br /&gt;
:This parameter specifies the maximum number of backup copies to keep. Setting backup_copies to 0 will disable backups&lt;br /&gt;
:Available range: 0 to 100.  Default - 10&lt;br /&gt;
&lt;br /&gt;
====compact_internal_databases====&lt;br /&gt;
:''&amp;lt;compact_internal_databases&amp;gt;1&amp;lt;/compact_internal_databases&amp;gt;&lt;br /&gt;
:This parameter specifies when the internal sqlite databases should be defragmented.&lt;br /&gt;
:For more info see: https://www.sqlite.org/lang_vacuum.html&lt;br /&gt;
:Values: 0 - Never, 1 - On server start only after basic backup, 2 - On server start always.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====crash_dump_upload====&lt;br /&gt;
:''&amp;lt;crash_dump_upload&amp;gt;1&amp;lt;/crash_dump_upload&amp;gt;&lt;br /&gt;
:This parameter specifies whether server crash dump files should be sent to MTA HQ.&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 1&lt;br /&gt;
&lt;br /&gt;
====fakelag====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf --&amp;gt;&lt;br /&gt;
:''&amp;lt;fakelag&amp;gt;0&amp;lt;/fakelag&amp;gt;&lt;br /&gt;
:This parameter specifies whether the [[Command fakelag|fakelag and sfakelag]] commands are enabled&lt;br /&gt;
:Values: 0 - Off, 1 - On. Default - 0&lt;br /&gt;
&lt;br /&gt;
====auth_serial_groups====&lt;br /&gt;
:''&amp;lt;auth_serial_groups&amp;gt;Admin&amp;lt;/auth_serial_groups&amp;gt;&lt;br /&gt;
:This parameter lists the ACL groups that are protected by serial authorization.&lt;br /&gt;
:Login attempts to a protected account from a second serial are blocked until the serial is manually authorized via the authserial command.&lt;br /&gt;
:For more info see: https://mtasa.com/authserial&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_groups can affect visibility in the master server list.&lt;br /&gt;
:Values: Comma separated list of ACL groups.  Default - Admin&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http====&lt;br /&gt;
:''&amp;lt;auth_serial_http&amp;gt;1&amp;lt;/auth_serial_http&amp;gt;&lt;br /&gt;
:This parameter specifies if the authorized serial login checks should also apply to the http interface.&lt;br /&gt;
:Protected account login attempts to the http interface will only succeed if the IP address matches one recently used by the account holder in-game.&lt;br /&gt;
:For more info see: https://mtasa.com/authserialhttp&lt;br /&gt;
:Note: This is security critical feature and disabling auth_serial_http can affect visibility in the master server list.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====auth_serial_http_ip_exceptions====&lt;br /&gt;
:''&amp;lt;auth_serial_http_ip_exceptions&amp;gt;127.0.0.1&amp;lt;/auth_serial_http_ip_exceptions&amp;gt;&lt;br /&gt;
:This parameter specifies which IP addresses should always pass auth_serial_http checks.&lt;br /&gt;
:Values: Comma separated list of IP addresses&lt;br /&gt;
&lt;br /&gt;
====database_credentials_protection====&lt;br /&gt;
:''&amp;lt;database_credentials_protection&amp;gt;1&amp;lt;/database_credentials_protection&amp;gt;&lt;br /&gt;
:This parameter specifies if extra security measures are applied to resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:The extra measures are:&lt;br /&gt;
: - script files cannot be accessed with [[fileOpen]]&lt;br /&gt;
: - [[meta.xml]] is read-only&lt;br /&gt;
:'''NOTE:''' This only protects resources which use [[dbConnect]] with MySQL.&lt;br /&gt;
:Values: 0 - Off, 1 - Enabled.  Default - 1&lt;br /&gt;
&lt;br /&gt;
====module====&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_win32.dll&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:''&amp;lt;nowiki&amp;gt;&amp;lt;!-- &amp;lt;module src=&amp;quot;sample_linux.so&amp;quot; /&amp;gt; --&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
:Specifies the module(s) which are loaded with the server. To load several modules, add more &amp;lt;module&amp;gt; parameter(s). Optional parameter.&lt;br /&gt;
&lt;br /&gt;
====resource====&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;admin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;defaultstats&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;helpmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;joinquit&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapcycler&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;mapmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;parachute&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcebrowser&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; default=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;resourcemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;1&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;scoreboard&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;spawnmanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;voice&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;votemanager&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;webadmin&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src=&amp;quot;play&amp;quot; startup=&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
:''&amp;lt;resource src-&amp;quot;resources&amp;quot; startup&amp;quot;1&amp;quot; protected=&amp;quot;0&amp;quot;&lt;br /&gt;
:Specifies persistent resources which are loaded when the server starts. Persistent resources are not stopped even if all the other resources that depend on them stop; that is, the only way to stop them is by explicitly using the ''stop'' server command or [[stopResource]] scripting function. To load several resources, add more &amp;lt;resource&amp;gt; parameters.&lt;br /&gt;
&lt;br /&gt;
:In addition, there are several flags which control how the server deals with each resource:&lt;br /&gt;
&lt;br /&gt;
:* '''src''': the resource name. This is the only mandatory flag.&lt;br /&gt;
:* '''startup''': controls whether the resource will be started with the server or not. If &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will be started. If not specified, defaults to not starting the resource.&lt;br /&gt;
:* '''protected''': if &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot;, the resource will not be able to be stopped when started. Otherwise, even if not specified, it will default to the normal behaviour.&lt;br /&gt;
:* '''default''': if given a &amp;quot;1&amp;quot;, &amp;quot;true&amp;quot; or &amp;quot;yes&amp;quot; value, this resource will be the one who populates the built-in HTTP server main page, which is seen when no resource is given in the web address. It is not possible to have more than one default resource.&lt;br /&gt;
&lt;br /&gt;
==Deprecated settings==&lt;br /&gt;
&lt;br /&gt;
The following settings have been deprecated in the production version of MTA:SA and no longer work.&lt;br /&gt;
&lt;br /&gt;
====networkencryption====&lt;br /&gt;
&amp;lt;!-- no longer present in mtaserver.conf - also seems to be deprecated in code --&amp;gt;&lt;br /&gt;
:''&amp;lt;networkencryption&amp;gt;1&amp;lt;/networkencryption&amp;gt;&lt;br /&gt;
:This parameter specifies whether communications between the server and client is encrypted. Encryption can help prevent network data being viewed and modified.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter.&lt;br /&gt;
:This parameter can changed and saved while the server is running with [[setServerConfigSetting]]&lt;br /&gt;
&lt;br /&gt;
====autologin====&lt;br /&gt;
&amp;lt;!-- removed from MTA:SA at https://github.com/multitheftauto/mtasa-blue/commit/e392c417da03b295c7f8342a7f6c1467d094db12#diff-b828bcbfff7135920f9a1179be3e3617 --&amp;gt;&lt;br /&gt;
:''&amp;lt;autologin&amp;gt;0&amp;lt;/autologin&amp;gt;&lt;br /&gt;
:Specifies whether or not players should automatically be logged in based on their IP adresses.&lt;br /&gt;
:Values: 0 - disabled , 1 - enabled ; default value: 0.&lt;br /&gt;
&lt;br /&gt;
[[Category: Support]]&lt;br /&gt;
[[ru:Server mtaserver.conf]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetScreenFromWorldPosition&amp;diff=76383</id>
		<title>GetScreenFromWorldPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetScreenFromWorldPosition&amp;diff=76383"/>
		<updated>2023-04-02T17:29:07Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Undo revision 76324 by Deihim007 (talk) it returns 3 values&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the screen position of a point in the world. This is useful for attaching 2D gui elements to parts of the world (e.g. players) or detecting if a point is on the screen (though it does not check if it is actually visible, you should use [[processLineOfSight]] for that).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float, float, float getScreenFromWorldPosition ( float x, float y, float z [, float edgeTolerance = 0.0, bool relative = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''x:''' A float value indicating the x position in the world.&lt;br /&gt;
*'''y:''' A float value indicating the y position in the world.&lt;br /&gt;
*'''z:''' A float value indicating the z position in the world.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''edgeTolerance:''' A [[float]] value indicating the distance the position can be off screen before the function returns false. Note: it's clamped down on both axies to the size of screen at the given axis*10&lt;br /&gt;
*'''relative:''' A [[boolean]] value that indicates if edgeTolerance is in pixels [false], or relative to the screen size [true].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two ''x'', ''y'' [[float]]s indicating the screen position and [[float]] distance between screen and given position if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;section class=&amp;quot;client&amp;quot; name=&amp;quot;Client-side Script&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a '3d' text at coordinates 0, 0, 0 (center of map).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
function ( )&lt;br /&gt;
	if ( getDistanceBetweenPoints3D ( 0, 0, 3, getElementPosition ( localPlayer ) ) ) &amp;lt; 50 then&lt;br /&gt;
		local coords = { getScreenFromWorldPosition ( 0, 0, 3 ) }&lt;br /&gt;
		if coords[1] and coords[2] then&lt;br /&gt;
			dxDrawText ( &amp;quot;Hello !&amp;quot;, coords[1], coords[2], coords[1], coords[2], tocolor(255,255,255), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
		end&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;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetScreenFromWorldPosition&amp;diff=76321</id>
		<title>GetScreenFromWorldPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetScreenFromWorldPosition&amp;diff=76321"/>
		<updated>2023-03-31T21:37:37Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Undo revision 76318 by LordHenry (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function gets the screen position of a point in the world. This is useful for attaching 2D gui elements to parts of the world (e.g. players) or detecting if a point is on the screen (though it does not check if it is actually visible, you should use [[processLineOfSight]] for that).&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
float, float, float getScreenFromWorldPosition ( float x, float y, float z [, float edgeTolerance = 0.0, bool relative = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''x:''' A float value indicating the x position in the world.&lt;br /&gt;
*'''y:''' A float value indicating the y position in the world.&lt;br /&gt;
*'''z:''' A float value indicating the z position in the world.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}}&lt;br /&gt;
{{New feature/item|3|1.0||&lt;br /&gt;
*'''edgeTolerance:''' A [[float]] value indicating the distance the position can be off screen before the function returns false. Note: it's clamped down on both axies to the size of screen at the given axis*10&lt;br /&gt;
*'''relative:''' A [[boolean]] value that indicates if edgeTolerance is in pixels [false], or relative to the screen size [true].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns two ''x'', ''y'' [[float]]s indicating the screen position and [[float]] distance between screen and given position if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
&amp;lt;section class=&amp;quot;client&amp;quot; name=&amp;quot;Client-side Script&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example add a '3d' text at coordinates 0, 0, 0 (center of map).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler ( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
function ( )&lt;br /&gt;
	if ( getDistanceBetweenPoints3D ( 0, 0, 3, getElementPosition ( localPlayer ) ) ) &amp;lt; 50 then&lt;br /&gt;
		local coords = { getScreenFromWorldPosition ( 0, 0, 3 ) }&lt;br /&gt;
		if coords[1] and coords[2] then&lt;br /&gt;
			dxDrawText ( &amp;quot;Hello !&amp;quot;, coords[1], coords[2], coords[1], coords[2], tocolor(255,255,255), 1, &amp;quot;default-bold&amp;quot; )&lt;br /&gt;
		end&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;
==See Also==&lt;br /&gt;
{{Client_world_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementBoneMatrix&amp;diff=76026</id>
		<title>SetElementBoneMatrix</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementBoneMatrix&amp;diff=76026"/>
		<updated>2023-01-15T15:06:48Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Reverted edits by Synthetic (talk) to last revision by Lvrent&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20704|This function sets the transformation matrix of a specific bone. Currently the [[Element/Player|Player]] and [[Element/Ped|Ped]] element types are accepted.}}&lt;br /&gt;
{{Tip|If you want to attach an element to a bone, see [[attachElementToBone]].}}&lt;br /&gt;
{{Tip|For [[matrix]] manipulation which goes beyond the basic examples given on this page, see the [[Lua matrix library]]. Using the built-in [[matrix]] class is also recommended.}}&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 setElementBoneMatrix ( element theElement, int boneId, matrix matrix )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' the [[element]] to set the bone matrix on.&lt;br /&gt;
*'''boneId:''' the ID of the bone. See [[Bone IDs]].&lt;br /&gt;
*'''matrix:''' the MTA [[matrix]] to set.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
{{Needs Example}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.5.8-9.20704|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_element_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementBonePosition&amp;diff=75714</id>
		<title>SetElementBonePosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementBonePosition&amp;diff=75714"/>
		<updated>2022-12-06T16:44:58Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Reverted edits by GustavoFreire (talk) to last revision by AncienT&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Added feature/item|1.5.9|1.5.8|20704|This function sets the position of a bone to the specified coordinates. Currently the [[Element/Player|Player]] and [[Element/Ped|Ped]] element types are accepted.}}&lt;br /&gt;
{{Tip|If you want to attach an element to a bone, see [[attachElementToBone]].}}&lt;br /&gt;
{{Note|You need to use this function together with [[onClientPedsProcessed]].}}&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 setElementBonePosition ( element theElement, int bone, float x, float y, float z )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' the [[Element|element]] to set the bone position on.&lt;br /&gt;
*'''bone:''' the ID of the bone to set the position of. See [[Bone IDs]].&lt;br /&gt;
*'''x:''' The X coordinate of the destination.&lt;br /&gt;
*'''y:''' The Y coordinate of the destination.&lt;br /&gt;
*'''z:''' The Z coordinate of the destination.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
[[File:CJ with long neck.png|thumb|alt=CJ with long neck|Example preview]]&lt;br /&gt;
This example shows a surprised CJ with a long neck&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local bones = {&lt;br /&gt;
    [4] = Vector3(0, 0, 0.15),&lt;br /&gt;
    [5] = Vector3(0, 0, 0.15),&lt;br /&gt;
    [6] = Vector3(0, 0, 0.13),&lt;br /&gt;
    [7] = Vector3(0, 0, 0.13),&lt;br /&gt;
    [8] = Vector3(0, 0, 0.1),&lt;br /&gt;
}&lt;br /&gt;
function updatePed()&lt;br /&gt;
    for bone,v in pairs(bones) do&lt;br /&gt;
        local pos = localPlayer:getBonePosition(bone)+v&lt;br /&gt;
        setElementBonePosition(localPlayer, bone, pos)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientPedsProcessed&amp;quot;, root, updatePed)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.5.8-9.20704|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_element_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerWasted&amp;diff=75671</id>
		<title>OnPlayerWasted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerWasted&amp;diff=75671"/>
		<updated>2022-11-14T21:46:47Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Killer element type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player is killed or dies.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
{{New feature/item|3|1.0||&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int totalAmmo, element killer, int killerWeapon, int bodypart, bool stealth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
{{Deprecated_feature|3|1.0|&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int totalAmmo, element killer, int killerWeapon, int bodypart&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
*'''totalAmmo''': an [[int]] representing the total ammo the victim had when they died.&lt;br /&gt;
*'''killer''': an [[element]] representing the [[player]], [[ped]], [[vehicle]] or [[object]] who was the killer. Deaths resulting from fall damage provide the [[vehicle]] or [[object]] landed on as the killer. If there is no killer this is ''false''.&lt;br /&gt;
*'''killerWeapon''': an [[int]] representing the [[Weapons|killer weapon]] or the [[Damage Types|damage type]].&lt;br /&gt;
*'''bodypart''': an [[int]] representing the bodypart ID the victim was hit on when they died.&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
*'''stealth''': a [[boolean]] value representing whether or not this was a stealth kill.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that died or got killed.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example prints the killer and bodypart to the chat when a player dies.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- register player_Wasted as a handler for onPlayerWasted&lt;br /&gt;
function player_Wasted ( ammo, attacker, weapon, bodypart )&lt;br /&gt;
	-- if there was an attacker&lt;br /&gt;
	if ( attacker ) then&lt;br /&gt;
		-- we declare our variable outside the following checks&lt;br /&gt;
		local tempString&lt;br /&gt;
		-- if the element that killed him was a player,&lt;br /&gt;
		if ( getElementType ( attacker ) == &amp;quot;player&amp;quot; ) then&lt;br /&gt;
			-- put the attacker, victim and weapon info in the string&lt;br /&gt;
			tempString = getPlayerName ( attacker )..&amp;quot; killed &amp;quot;..getPlayerName ( source )..&amp;quot; (&amp;quot;..getWeaponNameFromID ( weapon )..&amp;quot;)&amp;quot;&lt;br /&gt;
		-- else, if it was a vehicle,&lt;br /&gt;
		elseif ( getElementType ( attacker ) == &amp;quot;vehicle&amp;quot; ) then&lt;br /&gt;
			-- we'll get the name from the attacker vehicle's driver&lt;br /&gt;
			tempString = getPlayerName ( getVehicleController ( attacker ) )..&amp;quot; killed &amp;quot;..getPlayerName ( source )..&amp;quot; (&amp;quot;..getWeaponNameFromID ( weapon )..&amp;quot;)&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		-- if the victim was shot in the head, append a special message&lt;br /&gt;
		if ( bodypart == 9 ) then&lt;br /&gt;
			tempString = tempString..&amp;quot; (HEADSHOT!)&amp;quot;&lt;br /&gt;
		-- else, just append the bodypart name&lt;br /&gt;
		else&lt;br /&gt;
			tempString = tempString..&amp;quot; (&amp;quot;..getBodyPartName ( bodypart )..&amp;quot;)&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		-- display the message&lt;br /&gt;
		outputChatBox ( tempString )&lt;br /&gt;
	-- if there was no attacker,&lt;br /&gt;
	else&lt;br /&gt;
		-- output a death message without attacker info&lt;br /&gt;
		outputChatBox ( getPlayerName ( source )..&amp;quot; died. (&amp;quot;..getWeaponNameFromID ( weapon )..&amp;quot;) (&amp;quot;..getBodyPartName ( bodypart )..&amp;quot;)&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerWasted&amp;quot;, root, player_Wasted )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And another example, this will spawn you in the middle of GTA SA world (x=0, y=0, z=3) after 2 seconds of your death&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler( &amp;quot;onPlayerWasted&amp;quot;, root,&lt;br /&gt;
	function()&lt;br /&gt;
		setTimer( spawnPlayer, 2000, 1, source, 0, 0, 3 )&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;br /&gt;
&lt;br /&gt;
[[ru:onPlayerWasted]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPedWasted&amp;diff=75670</id>
		<title>OnPedWasted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPedWasted&amp;diff=75670"/>
		<updated>2022-11-14T21:46:25Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Killer element type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a ped is killed or dies. It is not triggered for players.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;int totalAmmo, element killer, int killerWeapon, int bodypart, bool stealth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*'''totalAmmo''': an [[int]] representing the total ammo the victim had when he died.&lt;br /&gt;
*'''killer''': an [[element]] representing the [[player]], [[ped]] or [[vehicle]] who was the killer.  If there was no killer this is ''false''.&lt;br /&gt;
*'''killerWeapon''': an [[int]] representing the [[Weapons|killer weapon]] or the [[Damage Types|damage types]].&lt;br /&gt;
*'''bodypart''': an [[int]] representing the bodypart ID the victim was hit on when he died.&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
*'''stealth''': a [[boolean]] representing whether or not this was a stealth kill.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[ped]] that died or got killed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example outputs to the console that the ped is now dead.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
ped1 = createPed(112, 0, 0, 0) --Create our Ped&lt;br /&gt;
function died()&lt;br /&gt;
    outputConsole(&amp;quot;Your Ped is dead now!&amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPedWasted&amp;quot;, ped1, died) --Add the Event when ped1 dies&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Ped events}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientPlayerWasted&amp;diff=75669</id>
		<title>OnClientPlayerWasted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientPlayerWasted&amp;diff=75669"/>
		<updated>2022-11-14T21:38:44Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Killer element type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client event}}&lt;br /&gt;
This event is triggered whenever a player, including those remote, dies.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element killer, int weapon, int bodypart, bool stealth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''killer''': A [[player]], [[ped]] or [[vehicle]] [[element]] representing the killer.&lt;br /&gt;
*'''weapon''': An [[int|integer]] representing the [[Weapons|killer weapon]] or the [[Damage Types|damage types]].&lt;br /&gt;
*'''bodypart''': An [[int|integer]] representing the bodypart the player was damaged.&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
*'''stealth''': A [[boolean]] representing whether or not this was a stealth kill.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] that died.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example outputs a mocking message when the local player dies.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
messages = { &lt;br /&gt;
&amp;quot;Better luck next time&amp;quot;,&lt;br /&gt;
&amp;quot;Don't think you're so cool now, do you?&amp;quot;,&lt;br /&gt;
&amp;quot;Nice one, pal&amp;quot;,&lt;br /&gt;
&amp;quot;Your opinion is void&amp;quot; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function wastedMessage ( killer, weapon, bodypart )&lt;br /&gt;
	local randomID = math.random ( 1, #messages ) --get a random ID from the table&lt;br /&gt;
	local randomMessage = messages[randomID] --use that to retrieve a message&lt;br /&gt;
	outputChatBox ( randomMessage, 255, 0, 0 ) --output the message&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onClientPlayerWasted&amp;quot;, getLocalPlayer(), wastedMessage ) --add an event for the local player only&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client player events===&lt;br /&gt;
{{Client_player_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnClientPedWasted&amp;diff=75668</id>
		<title>OnClientPedWasted</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnClientPedWasted&amp;diff=75668"/>
		<updated>2022-11-14T21:38:03Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Killer element type&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client event}}&lt;br /&gt;
&lt;br /&gt;
This event is triggered whenever a ped dies.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
element killer, int weapon, int bodypart, float loss / bool stealth&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''killer''': A [[player]], [[ped]] or [[vehicle]] [[element]] representing the killer.&lt;br /&gt;
*'''weapon''': An [[int|integer]] representing the [[Weapons|killer weapon]] or the [[Damage Types|damage types]].&lt;br /&gt;
*'''bodypart''': An [[int|integer]] representing the bodypart the player was damaged.&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
*'''loss''': A [[float]] representing the percentage of health the ped lost in the final &amp;quot;hit&amp;quot;. ''Note: Only for client-side created peds.''&lt;br /&gt;
'''OR'''&lt;br /&gt;
*'''stealth''': A [[boolean]] representing whether or not this was a stealth kill.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[ped]] that died.&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 example outputs a message every time a player kills another player.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
-- define the event handler function&lt;br /&gt;
function onWasted(killer, weapon, bodypart)&lt;br /&gt;
    if ( killer and getElementType(killer) == &amp;quot;player&amp;quot; and getElementType(source) == &amp;quot;player&amp;quot; ) then&lt;br /&gt;
        outputChatBox(getPlayerName(killer)..&amp;quot; has killed &amp;quot;.. getPlayerName(source) ..&amp;quot;.&amp;quot;) -- output the kill message to the chatbox.&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- add the event handler&lt;br /&gt;
addEventHandler(&amp;quot;onClientPedWasted&amp;quot;, getRootElement(), onWasted)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
===Client ped events===&lt;br /&gt;
{{Client_ped_events}}&lt;br /&gt;
===Client event functions===&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Installing_and_Configuring_Nginx_as_an_External_Web_Server&amp;diff=75657</id>
		<title>Installing and Configuring Nginx as an External Web Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Installing_and_Configuring_Nginx_as_an_External_Web_Server&amp;diff=75657"/>
		<updated>2022-11-06T10:10:02Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Added note on 403&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Internal vs External==&lt;br /&gt;
The MTA:SA server comes with a built-in 'internal' HTTP server which clients use to automatically download resource files. It is only a basic HTTP server which does not support compression or multiple client connections. &lt;br /&gt;
By adding an external HTTP server such as '''nginx''' or '''lighttpd''', resource download speed can be increased and bandwidth usage (and player waiting time) decreased.&lt;br /&gt;
Note that the external HTTP server can be on the same machine as the MTA server.&lt;br /&gt;
&lt;br /&gt;
==nginx vs Apache==&lt;br /&gt;
We recommend nginx or lighttpd as they are better suited to handle the hundreds of file requests that MTA:SA clients will generate. Apache can be used, but will require settings tweaking and the mtasever.conf setting &amp;lt;'''httpmaxconnectionsperclient'''&amp;gt; may have to be reduced to prevent timeouts.&lt;br /&gt;
&lt;br /&gt;
The following guide is for installing and configuring nginx solely for MTA:SA. It assumes:&lt;br /&gt;
* You are not already using nginx for other web sites on your server.&lt;br /&gt;
* MTA:SA server is installed on the same server.&lt;br /&gt;
* You are using Debian 7 (but should work on other distributions in a similar way.)&lt;br /&gt;
&lt;br /&gt;
==Installing nginx:==&lt;br /&gt;
Update system:&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get upgrade&lt;br /&gt;
&lt;br /&gt;
Install nginx:&lt;br /&gt;
 apt-get install nginx&lt;br /&gt;
&lt;br /&gt;
Ensure nginx is not running:&lt;br /&gt;
 /etc/init.d/nginx stop&lt;br /&gt;
&lt;br /&gt;
==Configuring nginx:==&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
====Edit: /etc/nginx/sites-available/default====&lt;br /&gt;
Find the ''''root'''' line and change it to point to the '''''http-client-files''''' directory in your MTA:SA server install:&lt;br /&gt;
 root /PATH_TO_MTA_SERVER/mods/deathmatch/resource-cache/http-client-files;&lt;br /&gt;
Find the ''''listen'''' and change it to use an unused server port: (Remove # if present)&lt;br /&gt;
 listen 20080;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
====Edit: /etc/nginx/sites-enabled/mta-server1====&lt;br /&gt;
In the directory '''/etc/nginx/sites-enabled/''' create a file called '''mta-server1''' with the following content:&lt;br /&gt;
 server {&lt;br /&gt;
     listen 20080;&lt;br /&gt;
     root /PATH_TO_MTA_SERVER/mods/deathmatch/resource-cache/http-client-files;&lt;br /&gt;
     server_name localhost;&lt;br /&gt;
     access_log off;&lt;br /&gt;
     autoindex off;&lt;br /&gt;
 }&lt;br /&gt;
'''**Important**: Change PATH_TO_MTA_SERVER to the actual absolute path of your MTA:SA server install directory'''&lt;br /&gt;
====Edit: /etc/nginx/nginx.conf====&lt;br /&gt;
At the top of the file, add this line to increase the max number of files that can be opened:&lt;br /&gt;
 worker_rlimit_nofile 5000;&lt;br /&gt;
Find the ''''worker_connections'''' line and change it to this:&lt;br /&gt;
 worker_connections 5000;&lt;br /&gt;
Find the ''''gzip'''' settings and make sure gzip is on:&lt;br /&gt;
 gzip on;&lt;br /&gt;
and ''''gzip_types'''' is set for any file type:&lt;br /&gt;
 gzip_types *;&lt;br /&gt;
&lt;br /&gt;
==Testing nginx:==&lt;br /&gt;
Start nginx:&lt;br /&gt;
 /etc/init.d/nginx start&lt;br /&gt;
&lt;br /&gt;
=====Test #1=====&lt;br /&gt;
Open your internet browser, and try this address: '''&amp;lt;nowiki&amp;gt;http://YOUR_SERVER_IP:20080/admin/client/admin_ACL.lua&amp;lt;/nowiki&amp;gt;'''&amp;lt;br/&amp;gt;&lt;br /&gt;
If prompted to download a file - SUCCESS!&lt;br /&gt;
&lt;br /&gt;
'''Note''': If you are getting a 403 Forbidden response, nginx cannot access the files. Usually this means the user (www-data) is lacking ''execute'' permission on the server, mods, deathmatch, resource-cache, http-client-files folders.&lt;br /&gt;
&lt;br /&gt;
=====Test #2=====&lt;br /&gt;
To test the compression is working, go here: http://www.whatsmyip.org/http-compression-test/ and enter '''&amp;lt;nowiki&amp;gt;http://YOUR_SERVER_IP:20080/admin/client/admin_ACL.lua&amp;lt;/nowiki&amp;gt;''' in the white box and press 'Test'.&amp;lt;br/&amp;gt;&lt;br /&gt;
If green tick - SUCCESS!&lt;br /&gt;
&lt;br /&gt;
==Configure MTA:SA server:==&lt;br /&gt;
====Edit mtaserver.conf====&lt;br /&gt;
Set '''httpdownloadurl''' to be like this:&lt;br /&gt;
    &amp;lt;httpdownloadurl&amp;gt;'''&amp;lt;nowiki&amp;gt;http://YOUR_SERVER_IP:20080&amp;lt;/nowiki&amp;gt;'''&amp;lt;/httpdownloadurl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And start MTA:SA server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
==Test it all works!==&lt;br /&gt;
Connect MTA:SA client and view nginx log files to confirm files are being downloaded: '''/var/log/nginx/access.log'''&lt;br /&gt;
&lt;br /&gt;
==Final thing==&lt;br /&gt;
To improve performance, and to avoid huge boring log files, edit '''/etc/nginx/sites-available/default''' and add this line under the '''listen''' one:&lt;br /&gt;
 access_log off;&lt;br /&gt;
and reload the nginx configuration:&lt;br /&gt;
 /etc/init.d/nginx reload&lt;br /&gt;
--&amp;gt;&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=TriggerLatentServerEvent&amp;diff=75357</id>
		<title>TriggerLatentServerEvent</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=TriggerLatentServerEvent&amp;diff=75357"/>
		<updated>2022-08-17T21:11:46Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Added as note and link to issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is the same as [[triggerServerEvent]] except the transmission rate of the data contained in the arguments can be limited and other network traffic is not blocked while the data is being transferred.&lt;br /&gt;
&lt;br /&gt;
{{Note|Calling [[kickPlayer]] inside a function which was called from triggerLatentServerEvent causes server to crash. ([https://github.com/multitheftauto/mtasa-blue/issues/2386 #2386])}}&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 triggerLatentServerEvent ( string event, [int bandwidth=5000, bool persist=false,] element theElement, [arguments...] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''event:''' The name of the event to trigger server-side. You should register this event with [[addEvent]] and add at least one event handler using [[addEventHandler]].&lt;br /&gt;
*'''theElement:''' The element that is the [[Event system#Event handlers|source]] of the event. This could be another player, or if this isn't relevant, use the root element.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''bandwidth:''' The bytes per second rate to send the data contained in the arguments.&lt;br /&gt;
*'''persist:''' A bool indicating whether the transmission should be allowed to continue even after the resource that triggered it has since stopped.&lt;br /&gt;
*'''arguments...:''' A list of arguments to trigger with the event. You can pass any Lua data type (except functions). You can also pass [[element]]s. The total amount of data should not exceed 100MB. &lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the event trigger has been sent, ''false'' if invalid arguments were specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
if fileExists(&amp;quot;text.txt&amp;quot;)&lt;br /&gt;
	file = fileOpen(&amp;quot;test.txt&amp;quot;)						--Open a file (you can create it yourself).&lt;br /&gt;
	local data = fileRead(file,100*1024*1024)				--Max 100 MB&lt;br /&gt;
	fileClose(file)								--Close File&lt;br /&gt;
	triggerLatentServerEvent(&amp;quot;onReadFile&amp;quot;,5000,false,root,data)	--trigger&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEvent(&amp;quot;onReadFile&amp;quot;,true)&lt;br /&gt;
addEventHandler(&amp;quot;onReadFile&amp;quot;,root,function(data)&lt;br /&gt;
	local file = fileCreate(&amp;quot;text.txt&amp;quot;)					--Save &amp;quot;data&amp;quot; into &amp;quot;text.txt&amp;quot;&lt;br /&gt;
	fileWrite(file,data)&lt;br /&gt;
	fileClose(file)&lt;br /&gt;
end)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03772|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_event_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWorldSpecialPropertyEnabled&amp;diff=74456</id>
		<title>SetWorldSpecialPropertyEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWorldSpecialPropertyEnabled&amp;diff=74456"/>
		<updated>2022-04-10T17:31:37Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
&lt;br /&gt;
Enables or disables a special world property.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setWorldSpecialPropertyEnabled ( string propname, bool enable )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||||isWorldSpecialPropertyEnabled}}&lt;br /&gt;
[[File:Randomfoliage.jpeg|frame|right|A photo demonstrating ''randomfoliage'' enabled and disabled.]]&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''propname:''' the name of the property to set. Possible values are:&lt;br /&gt;
**'''hovercars''' - equivalent of the JBGVNB cheat, and allows cars to drive on water.&lt;br /&gt;
**'''aircars''' - equivalent of the RIPAZHA cheat, and allows cars to fly.&lt;br /&gt;
**'''extrabunny''' - equivalent of the CJPHONEHOME or JHJOECW cheat, and allows you to bunny hop on bicycles much higher.&lt;br /&gt;
**'''extrajump''' - equivalent of the KANGAROO cheat, and allows you to jump on foot much higher.&lt;br /&gt;
**'''randomfoliage''' - toggle randomly generated foliage on the GTA:SA map (default: true)&lt;br /&gt;
**'''snipermoon''' - toggle the GTA:SA easter egg, which increases the size of the moon every time you shoot it with a sniper rifle (default: false)&lt;br /&gt;
**'''extraairresistance''' - toggle the vehicle speed limit on cross-country roads (default: true)&lt;br /&gt;
**{{New feature/item|3.0156|1.5.5|12286|'''underworldwarp''' - toggle warp of peds and vehicles when fall under map (default: true)}}&lt;br /&gt;
**{{New feature/item|1.5.9|1.5.9|21125|'''vehiclesunglare''' - toggle the vehicle sun glare effect (default: false) }}&lt;br /&gt;
*'''enable:''' whether or not to enable the property.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
'''Example 1:''' Allows cars to fly.&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;
        setWorldSpecialPropertyEnabled( &amp;quot;aircars&amp;quot;, true )&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Example 2:''' Allow cars to drive on water.&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;
        setWorldSpecialPropertyEnabled( &amp;quot;hovercars&amp;quot;, true )&lt;br /&gt;
    end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{ChangelogHeader}}&lt;br /&gt;
{{ChangelogItem|1.5.5-3.12286|Added &amp;quot;underworldwarp&amp;quot; property}}&lt;br /&gt;
{{ChangelogItem|1.5.9-1.21125|Added &amp;quot;vehiclesunglare&amp;quot; property}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=IsVehicleOnGround&amp;diff=73942</id>
		<title>IsVehicleOnGround</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=IsVehicleOnGround&amp;diff=73942"/>
		<updated>2022-01-31T21:15:01Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Added note regarding isVehicleWheelOnGround&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
Checks to see if a vehicle has contact with the ground.&lt;br /&gt;
&lt;br /&gt;
{{Note|This function has a few issues, see below. Consider using the clientside function [[isVehicleWheelOnGround]] instead.}}&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 isVehicleOnGround ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[vehicle]]:isOnGround|onGround}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to check.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if vehicle is on the ground, ''false'' if it is not.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&lt;br /&gt;
This example tells you when you've jumped out of a vehicle.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkVState ( vehicle, seat, jacked )&lt;br /&gt;
	vehName = getVehicleName ( vehicle )&lt;br /&gt;
&lt;br /&gt;
	if isVehicleOnGround ( vehicle ) == false then&lt;br /&gt;
		outputChatBox ( &amp;quot;You jumped out of a &amp;quot;..vehName..&amp;quot;!&amp;quot;, source, 255, 0, 0  )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerVehicleExit&amp;quot;, getRootElement(), checkVState )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|471|isVehicleOnGround sometimes returns false incorrectly}}&lt;br /&gt;
{{Issue|2093|isVehicleOnGround does not work after setVehicleHandling}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RU/onPlayerChangeNick&amp;diff=73921</id>
		<title>RU/onPlayerChangeNick</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RU/onPlayerChangeNick&amp;diff=73921"/>
		<updated>2022-01-30T19:04:39Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed fixed issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RU/Server event}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
Это событие вызывается, когда игрок меняет свой ник.&lt;br /&gt;
&lt;br /&gt;
==Параметры== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string oldNick, string newNick, bool changedByUser&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
*'''oldNick'''. Ник, который игрок имел раньше.&lt;br /&gt;
*'''newNick'''. Новый ник игрока.&lt;br /&gt;
{{RU/New items|3.0154|1.5.3|&lt;br /&gt;
*'''changedByUser'''. Было ли имя изменено с помощью функции [[RU/setPlayerName|setPlayerName]] или пользователем.&lt;br /&gt;
|9765}}&lt;br /&gt;
&lt;br /&gt;
==Источник==&lt;br /&gt;
[[RU/Event system|Источником]] этого события является [[RU/Element/Player|игрок]], который изменил свой ник.&lt;br /&gt;
&lt;br /&gt;
==Отмена эффекта==&lt;br /&gt;
[[RU/Event system#Отмена событий|Отмена]] этого события зависит от того, как оно вызывается. Если оно вызывается скриптинговым событием, тогда оно не отменяется. Если оно вызывается командой ''/nick'', оно отменяется. Если это событие отменено и может быть отменено, имя не изменится.&lt;br /&gt;
&lt;br /&gt;
==Примеры== &lt;br /&gt;
'''Пример 1'''. В этом примере отменяется событие, если ник уже существует.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function nickChangeHandler(oldNick, newNick)&lt;br /&gt;
    if getAccount(newNick) then&lt;br /&gt;
        outputChatBox(&amp;quot;К сожалению, уже существует аккаунт с Вашим новым ником как имя пользователя.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        outputChatBox(&amp;quot;Пожалуйста, выберите другой.&amp;quot;, source, 0, 255, 0)&lt;br /&gt;
        cancelEvent()&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), nickChangeHandler)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{RU/New items|3.0154|1.5.3|&lt;br /&gt;
'''Пример 2'''. В этом примере проверяется, был ли ник игрока изменён скриптом и, если это так, логируется.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function wasNickChangedByUser(oldNick, newNick, changedByUser)&lt;br /&gt;
    if changedByUser == false then&lt;br /&gt;
        outputServerLog(&amp;quot;Имя игрока &amp;quot;..oldNick..&amp;quot; было изменено на &amp;quot;..newNick..&amp;quot; скриптом.&amp;quot;)&lt;br /&gt;
    end	&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onPlayerChangeNick&amp;quot;, getRootElement(), wasNickChangedByUser)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;|9765}}&lt;br /&gt;
&lt;br /&gt;
{{RU/See also/Server event|RU/Player events|События игрока}}&lt;br /&gt;
&lt;br /&gt;
[[en:onPlayerChangeNick]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=WarpPedIntoVehicle&amp;diff=73920</id>
		<title>WarpPedIntoVehicle</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=WarpPedIntoVehicle&amp;diff=73920"/>
		<updated>2022-01-30T19:02:49Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function is used to warp or force a ped into a vehicle.  There are no animations involved when this happens.&lt;br /&gt;
&lt;br /&gt;
[[File:vehicle seat ids.png|200px|thumb|right|Vehicle seat ids]] &lt;br /&gt;
&lt;br /&gt;
'''Available client side from 1.3.1''' (It will only work with client side vehicles and peds)&lt;br /&gt;
{{Important Note|If you used [[setElementPosition]] to spawn the [[ped]]/[[player]], this function will not work and returns '''false'''.}}&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 warpPedIntoVehicle ( ped thePed, vehicle theVehicle, [ int seat=0 ] )          &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{OOP|Set the variable to nil to execute [[removePedFromVehicle]]|[[ped]]:warpIntoVehicle|vehicle|getPedOccupiedVehicle}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePed:''' The ped which you wish to force inside the vehicle&lt;br /&gt;
*'''theVehicle:''' The vehicle you wish to force the ped into&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
{{OptionalArg}} &lt;br /&gt;
*'''seat:''' An integer representing the seat ID.&lt;br /&gt;
** '''0:''' Front-left&lt;br /&gt;
** '''1:''' Front-right&lt;br /&gt;
** '''2:''' Rear-left&lt;br /&gt;
** '''3:''' Rear-right&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the operation is successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates a vehicle and warps a ped inside immediately.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function setupForRace ( )&lt;br /&gt;
    local RacerPed = createPed ( 252, 0, 0, 3 )&lt;br /&gt;
    local RaceVehicle = createVehicle ( 411, 4, 0, 3 )            -- create a vehicle.&lt;br /&gt;
    warpPedIntoVehicle ( RacerPed, RaceVehicle )                  -- warp the ped straight into the vehicle&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;startrace&amp;quot;, setupForRace )                   -- add a command to start race&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|475|Network trouble when calling warpPedIntoVehicle on resourceStart}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Ped functions}}&lt;br /&gt;
[[ru:warpPedIntoVehicle]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtLevel&amp;diff=73919</id>
		<title>SetVehicleDirtLevel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleDirtLevel&amp;diff=73919"/>
		<updated>2022-01-30T19:02:03Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Remove issue from disabled function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
{{Disabled|This function doesn't work actually. See the bugtracker for updates and more information.}}&lt;br /&gt;
This function sets the dirt level on a vehicle.&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 setVehicleDirtLevel ( vehicle theVehicle, int dirtLevel )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The vehicle that you want to set the dirt level from&lt;br /&gt;
*'''dirtLevel:''' The dirt level&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the dirt level was set on the vehicle, ''false'' if the dirt level was not set or if invalid arguments are specified.&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;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleColor&amp;diff=73918</id>
		<title>SetVehicleColor</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleColor&amp;diff=73918"/>
		<updated>2022-01-30T19:01:48Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed fixed issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function will set the color of a vehicle using either a RGB format, or the [[Vehicle Colors|standard San Andreas color IDs.]] Vehicles can have up to 4 colors, most of the vehicles have 2 colors only. &lt;br /&gt;
&lt;br /&gt;
{{New feature|3.0110|1.1|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleColor(vehicle veh, int r1, int g1, int b1, [int r2, int g2, int b2, int r3, int g3, int b3, int r4, int g4, int b4])            &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setVehicleColor(vehicle veh, int p1, int p2, int p3, int p4)            &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
{{OOP||[[vehicle]]:setColor}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theVehicle:''' The [[vehicle]] that you wish to set the color of.&lt;br /&gt;
* RGB format:&lt;br /&gt;
** '''r1, g1, b1:''' Three integers indicating the red, green and blue components of the first (main) color for the vehicle&lt;br /&gt;
* Palette format:&lt;br /&gt;
** '''p1, p2, p3, p4:''' Exactly four integers indicating the [[Vehicle Colors|vehicle color IDs]] from the palette. &amp;lt;br&amp;gt; If a vehicle has fewer than four colours, you must still provide four colours, otherwise the RGB format will be used.&lt;br /&gt;
===Optional Arguments (RGB format only)===&lt;br /&gt;
*'''r2, g2, b2:''' Three integers indicating the red, green and blue components of the second color for the vehicle&lt;br /&gt;
*'''r3, g3, b3:''' Three integers indicating the red, green and blue components of the third color for the vehicle&lt;br /&gt;
*'''r4, g4, b4:''' Three integers indicating the red, green and blue components of the fourth color for the vehicle&lt;br /&gt;
}}&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if vehicle's color was set, ''false'' if an invalid vehicle or invalid colors were specified.&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1 - RGB format&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example implements a serverside ''random_color'' console command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler( 'random_color',&lt;br /&gt;
	function( uPlayer )&lt;br /&gt;
		if isPedInVehicle( uPlayer ) then&lt;br /&gt;
			local uVehicle = getPedOccupiedVehicle( uPlayer )&lt;br /&gt;
			if uVehicle then&lt;br /&gt;
				local r, g, b = math.random( 255 ), math.random( 255 ), math.random( 255 )&lt;br /&gt;
				setVehicleColor( uVehicle, r, g, b )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 2 - palette format&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example implements a serverside command for the player to spawn a red and white Banshee, using the palette colors.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;banshee&amp;quot;, function(player)&lt;br /&gt;
    local x, y, z = getElementPosition(player)&lt;br /&gt;
    local rx, ry, rz = getElementRotation(player)&lt;br /&gt;
    local vehicle = createVehicle(429, x, y, z, 0.0, 0.0, rz, &amp;quot;PALETTE&amp;quot;)&lt;br /&gt;
    setVehicleColor(vehicle, 3, 1, 0, 0)-- A red and white Banshee!&lt;br /&gt;
    addVehicleUpgrade(vehicle, 1010)&lt;br /&gt;
    warpPedIntoVehicle(player, vehicle, 0)&lt;br /&gt;
    outputChatBox(&amp;quot;You have spawned a red and white Banshee! I also added NOS for you!&amp;quot;, source, 50, 168, 82)&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Vehicle_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetResourceDefaultSetting&amp;diff=73917</id>
		<title>SetResourceDefaultSetting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetResourceDefaultSetting&amp;diff=73917"/>
		<updated>2022-01-30T19:01:23Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Remove issue from disabled function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled|This function doesn't work actually. See [[#Issues|issues]] for more information.}}&lt;br /&gt;
This function is used to set a default setting for a specified [[resource]].&lt;br /&gt;
&amp;lt;!-- What are default settings? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setResourceDefaultSetting ( resource theResource, string settingName, string/int/float settingValue )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the resource where the setting is located&lt;br /&gt;
*'''settingName:''' the name of the default setting&lt;br /&gt;
*'''settingValue:''' the new value of the setting&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the default setting was successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example checks to see if the server has the freeroam server then sets &amp;quot;spawnmaponstart&amp;quot; to &amp;quot;false&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onResourceStart&amp;quot;,resourceRoot,function()&lt;br /&gt;
	local freeroamRes = getResourceFromName(&amp;quot;Freeroam&amp;quot;)&lt;br /&gt;
	if(freeroamRes)then&lt;br /&gt;
		setResourceDefaultSetting(freeroamRes,&amp;quot;spawnmaponstart&amp;quot;,&amp;quot;false&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetRadioChannel&amp;diff=73916</id>
		<title>SetRadioChannel</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetRadioChannel&amp;diff=73916"/>
		<updated>2022-01-30T19:00:49Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Updated issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function sets the heard radio channel, even while not in a vehicle.&lt;br /&gt;
{{Note|This function sometimes doesn't work when setting the radio channel to another different from the current one due to unknown reasons. If you experience this issue, simply add setRadioChannel(0) at the beginning of the script, outside any function.}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setRadioChannel ( int ID )             &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''ID:''' The ID of the radio station you want to play.&lt;br /&gt;
&lt;br /&gt;
{{SoundID}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if channel was set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example adds a command ''setradio'' which can be used to change the current radio station by ID.&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler ( &amp;quot;setradio&amp;quot;,&lt;br /&gt;
    function ( command, stationID )&lt;br /&gt;
        local result = setRadioChannel ( tonumber( stationID ) )&lt;br /&gt;
        if result then -- if we had a valid ID&lt;br /&gt;
            outputChatBox ( &amp;quot;Changed your radio station to &amp;quot; .. getRadioChannelName ( tonumber ( stationID ) ) .. &amp;quot;!&amp;quot; )&lt;br /&gt;
        else&lt;br /&gt;
            outputChatBox ( &amp;quot;Invalid radio station ID, valid ones are 0-12.&amp;quot; )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|423|setRadioChannel doesn't work when outside a vehicle}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
{{Client_audio_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setRadioChannel]]&lt;br /&gt;
[[AR:setRadioChannel]]&lt;br /&gt;
[[RO:SetRadioChannel]]&lt;br /&gt;
[[PT-BR:setRadioChannel]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=73915</id>
		<title>SetPedLookAt</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetPedLookAt&amp;diff=73915"/>
		<updated>2022-01-30T18:59:54Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Updated issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Note|Avoid calling setPedLookAt every frame as this can cause bugs like being invincible to burning.}}&lt;br /&gt;
{{Important Note|For remote players, you have to use [https://wiki.multitheftauto.com/wiki/SetPedAimTarget setPedAimTarget] before setPedLookAt.}}&lt;br /&gt;
Makes a ped turn his head and look at a specific world position or element.&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setPedLookAt ( ped thePed, float x, float y, float z [, int time = 3000 [, int blend = 1000 ], element target = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''thePed:''' the ped to change the lookat of.&lt;br /&gt;
*'''x:''' the x coordinate of the world position to look at.&lt;br /&gt;
*'''y:''' the y coordinate of the world position to look at.&lt;br /&gt;
*'''z:''' the z coordinate of the world position to look at.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''time:''' the time, in milliseconds, during which the ped will look at the target. Once this time has elapsed, he will look ahead again like before the function was applied. A time of 0 will immediately stop any lookat. A negative time will make the ped look at the target indefinitely.&lt;br /&gt;
*'''blend:''' the time, in milliseconds, during which the look will blend.&lt;br /&gt;
*'''target:''' if this argument is specified, the position arguments will be mean offsets relative to the target and the ped's gaze will follow the specified element instead. Can be a player, a vehicle, another ped etc.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example makes the local player look at where the camera points at. If you want to sync this effect with other players you can use [[triggerLatentServerEvent]] and [[triggerLatentClientEvent]] functions.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local screenSize_X, screenSize_Y = guiGetScreenSize()&lt;br /&gt;
&lt;br /&gt;
function pedLookAt()&lt;br /&gt;
   local x, y, z = getWorldFromScreenPosition(screenSize_X / 2, screenSize_Y / 2, 15)&lt;br /&gt;
   setPedLookAt(localPlayer, x, y, z, -1, 0)&lt;br /&gt;
end&lt;br /&gt;
setTimer(pedLookAt, 120, 0)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|509|setPedLookAt does not work for remote players}}&lt;br /&gt;
{{Issue|626|setPedLookAt cancels damage done by any sort of fire}}&lt;br /&gt;
}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client ped functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetObjectBreakable&amp;diff=73914</id>
		<title>SetObjectBreakable</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetObjectBreakable&amp;diff=73914"/>
		<updated>2022-01-30T18:58:49Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed fixed issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function sets an object to be breakable/unbreakable.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setObjectBreakable ( object theObject, bool breakable )&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[object]]:setBreakable|breakable|isObjectBreakable}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''object''' the [[object]] that's being set.&lt;br /&gt;
*'''breakable''' a boolean whether the object is breakable (true) or unbreakable (false).&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
* ''true'' if the object is now breakable.&lt;br /&gt;
* ''false'' if it can't or if invalid arguments are passed. &lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example creates an object when the resource starts and sets it to be breakable.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;function toggleObjectVulnerability()&lt;br /&gt;
	local object = createObject(1337, 5540.6654, 1020.55122, 1240.545)&lt;br /&gt;
	if isObjectBreakable(object) then&lt;br /&gt;
		setObjectBreakable(object, false)&lt;br /&gt;
		outputChatBox(&amp;quot;The object is now not breakable.&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		setObjectBreakable(object, true)&lt;br /&gt;
		outputChatBox(&amp;quot;The object is now breakable.&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, toggleObjectVulnerability)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|n/a|1.3.0-9.03783|}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_object_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetModelHandling&amp;diff=73913</id>
		<title>SetModelHandling</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetModelHandling&amp;diff=73913"/>
		<updated>2022-01-30T18:58:28Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Updated issues&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 all vehicles of a specified model.&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 setModelHandling ( int modelId, string property, var value ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''modelId:''' The [[Vehicle_IDs|vehicle model]] you wish to set the handling of.&lt;br /&gt;
*'''property:''' The property you wish to set the handling of the vehicle to, or ''nil'' if you want to reset the all the handling properties.&lt;br /&gt;
*'''value:''' The value of the models's handling property you wish to set, or ''nil'' if you want to reset the handling property to its default value.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the handling was set successfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Handling Properties==&lt;br /&gt;
See below a list of valid properties and their required values:&lt;br /&gt;
{{Handling Properties}}&lt;br /&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 script changes the handling of all Bullet.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function handlingChange()&lt;br /&gt;
	local modelId = 541&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;mass&amp;quot;, 1890)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;turnMass&amp;quot;, 3780)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;dragCoeff&amp;quot;, 0.7)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;centerOfMass&amp;quot;, {0.0, 0.1, -0.2} )&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;percentSubmerged&amp;quot;, 75)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;tractionMultiplier&amp;quot;, 0.70)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;tractionLoss&amp;quot;, 0.90)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;tractionBias&amp;quot;, 0.50)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;numberOfGears&amp;quot;, 5)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;maxVelocity&amp;quot;, 407)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;engineAcceleration&amp;quot;, 50)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;engineInertia&amp;quot;, 10)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;driveType&amp;quot;, &amp;quot;awd&amp;quot;)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;engineType&amp;quot;, &amp;quot;petrol&amp;quot;)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;brakeDeceleration&amp;quot;, 11)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;brakeBias&amp;quot;, 0.45)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;ABS&amp;quot;, false)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;steeringLock&amp;quot;, 30)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;suspensionForceLevel&amp;quot;, 0.80)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;suspensionDamping&amp;quot;, 0.20)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;suspensionHighSpeedDamping&amp;quot;, 0.0)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;suspensionUpperLimit&amp;quot;, 0.10)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;suspensionLowerLimit&amp;quot;, -0.09)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;suspensionFrontRearBias&amp;quot;, 0.5)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;suspensionAntiDiveMultiplier&amp;quot;, 0.6)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;seatOffsetDistance&amp;quot;, 0.3)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;collisionDamageMultiplier&amp;quot;, 0.50)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;monetary&amp;quot;, 1460000)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;modelFlags&amp;quot;, 0xC0222004)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;handlingFlags&amp;quot;, 0x1400000)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;headLight&amp;quot;, 1)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;tailLight&amp;quot;, 1)&lt;br /&gt;
	setModelHandling(modelId, &amp;quot;animGroup&amp;quot;, 0)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;, resourceRoot, handlingChange)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This function will reset the handling of Bullet vehicles to its default state.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function resetHandling()&lt;br /&gt;
	local modelId = 541&lt;br /&gt;
	for k,_ in pairs(getModelHandling(modelId)) do&lt;br /&gt;
		setModelHandling(modelId, k, nil)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStop&amp;quot;, resourceRoot, resetHandling)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|553|setModelHandling doesn't work with already created vehicles}}&lt;br /&gt;
{{Issue|1198|&amp;quot;setModelHandling&amp;quot; function doesn't affect vehicles that have been changed using &amp;quot;setElementModel&amp;quot;}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See other vehicle functions==&lt;br /&gt;
{{Vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetJetpackWeaponEnabled&amp;diff=73912</id>
		<title>SetJetpackWeaponEnabled</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetJetpackWeaponEnabled&amp;diff=73912"/>
		<updated>2022-01-30T18:56:39Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Updated issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
This function sets a weapon usable while using the Jetpack.&lt;br /&gt;
{{Note|colt 45, sawed-off, tec-9 and uzi are always enabled for the Jetpack and are not affected by this function}}&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setJetpackWeaponEnabled(string weapon, bool enabled)&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''weapon''' The weapon that's being set usable on a Jetpack. Names can be: (Case is ignored)&lt;br /&gt;
{{All Weapon Types}}&lt;br /&gt;
*'''enabled''' A bool representing whether the weapon is enabled or disabled.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true, else false if invalid arguments are passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onResourceStart&amp;quot;,resourceRoot,function()&lt;br /&gt;
     if setJetpackWeaponEnabled(&amp;quot;31&amp;quot;,true) then&lt;br /&gt;
          outputChatBox(getWeaponNameFromID(31)..&amp;quot; is now enabled for jetpacks!&amp;quot;)&lt;br /&gt;
     end&lt;br /&gt;
end)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local weapons = {&lt;br /&gt;
    31,&lt;br /&gt;
    34,&lt;br /&gt;
    33,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
addEventHandler(&amp;quot;onResourceStart&amp;quot;,resourceRoot,function()&lt;br /&gt;
    for i,v in ipairs(weapons) do&lt;br /&gt;
        if setJetpackWeaponEnabled(v,true) then&lt;br /&gt;
            outputChatBox(getWeaponNameFromID(v)..&amp;quot; is now enabled for jetpacks!&amp;quot;)&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Issues ==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|508|Texture bug with setJetpackWeaponEnabled.}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
{{Requirements|1.3.1|n/a|}}&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementPosition&amp;diff=73911</id>
		<title>SetElementPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementPosition&amp;diff=73911"/>
		<updated>2022-01-30T18:55:45Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Updated issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Shared function}}&lt;br /&gt;
This function sets the position of an element to the specified coordinates.&lt;br /&gt;
{{Warning|Do not use this function to spawn a [[player]]. It will cause problems with other functions like [[warpPedIntoVehicle]]. Use [[spawnPlayer]] instead.}}&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 setElementPosition ( element theElement, float x, float y, float z [, bool warp = true ] )  &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setPosition|position|getElementPosition}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' A valid [[element]] to be moved.&lt;br /&gt;
*'''x:''' The x coordinate of the destination.&lt;br /&gt;
*'''y:''' The y coordinate of the destination.&lt;br /&gt;
*'''z:''' The z coordinate of the destination.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''warp:''' teleports players, resetting any animations they were doing. Setting this to ''false'' preserves the current animation.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function 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 lets admins teleport 5 random players to themselves&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function randomPlayersToLocation(p)&lt;br /&gt;
    if not isPlayerStaff(p) then return end&lt;br /&gt;
&lt;br /&gt;
	local playersOnline = getElementsByType(&amp;quot;player&amp;quot;)&lt;br /&gt;
	local amount = #playersOnline&lt;br /&gt;
&lt;br /&gt;
	if amount == 0 then return end&lt;br /&gt;
&lt;br /&gt;
	for index = 1,(amount &amp;gt; 5 and 5 or amount) do&lt;br /&gt;
		local player = playersOnline[index]&lt;br /&gt;
		setElementPosition(player, getElementPosition(p))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;randomtp&amp;quot;, randomPlayersToLocation)&lt;br /&gt;
addCommandHandler(&amp;quot;playershere&amp;quot;, randomPlayersToLocation)&lt;br /&gt;
&lt;br /&gt;
-- Utility function&lt;br /&gt;
local staffACLs = {&lt;br /&gt;
    aclGetGroup(&amp;quot;Admin&amp;quot;),&lt;br /&gt;
    aclGetGroup(&amp;quot;Moderator&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function isPlayerStaff(p)&lt;br /&gt;
	if isElement(p) and getElementType(p) == &amp;quot;player&amp;quot; and not isGuestAccount(getPlayerAccount(p)) then&lt;br /&gt;
		local object = getAccountName(getPlayerAccount(p))&lt;br /&gt;
&lt;br /&gt;
		for _, group in ipairs(staffACLs) do&lt;br /&gt;
			if isObjectInACLGroup(&amp;quot;user.&amp;quot; .. object, group) then&lt;br /&gt;
				return true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&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;
If you want to put a vehicle or player out of the water or simulate the position-resetting behaviour if CJ goes below the ground too far, then you need to retrieve a recommended coordinate on ground to place the element at. Take a look at [https://forum.mtasa.com/topic/132891-important-helprespawn-vehicle/?do=findComment&amp;amp;comment=1003198 this MTA forums post] for steps in the right direction.&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|539|Changing player position when he/she has a jetpack will remove the jetpack and bug when skin is changed}}&lt;br /&gt;
{{Issue|529|Player falls from his bike when its teleported by setElementPosition}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setElementPosition]]&lt;br /&gt;
[[ru:setElementPosition]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementHealth&amp;diff=73910</id>
		<title>SetElementHealth</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementHealth&amp;diff=73910"/>
		<updated>2022-01-30T18:53:08Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Added more issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the health for the specified [[element]]. This can be a [[ped]], [[object]] or a [[vehicle]].&lt;br /&gt;
{{Note|In the case of the [[vehicle]] element, the following effects appear, depending on the health value:&lt;br /&gt;
*'''650:''' white steam 0%, black smoke 0%&lt;br /&gt;
*'''450:''' white steam 100%, black smoke 50%&lt;br /&gt;
*'''250:''' white steam 0%, black smoke 100%&lt;br /&gt;
*'''249:''' fire with big black smoke&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 setElementHealth ( element theElement, float newHealth )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[element]]:setHealth|health|getElementHealth}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theElement:''' The [[ped]], [[vehicle]] or [[object]] whose health you want to set.&lt;br /&gt;
*'''newHealth:''' A float indicating the new health to set for the element.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the new health was set successfully, or ''false'' if invalid arguments were passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example adds a 'hpslap' console command that lets players &amp;quot;slap&amp;quot; others (doing 20 damage).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function hpSlap ( sourcePlayer, command, targetPlayerName )&lt;br /&gt;
    -- check if the user has access to it first&lt;br /&gt;
    if not hasObjectPermissionTo(sourcePlayer, &amp;quot;command.slap&amp;quot;, false) then&lt;br /&gt;
        outputChatBox ( &amp;quot;You cannot use this command.&amp;quot;, sourcePlayer )&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    -- look up the player to be slapped&lt;br /&gt;
    local targetPlayer = getPlayerFromName ( targetPlayerName )&lt;br /&gt;
    -- if there's a player with such name,&lt;br /&gt;
    if targetPlayer then&lt;br /&gt;
        -- subtract 20 from his health&lt;br /&gt;
        setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - 20 )&lt;br /&gt;
    else&lt;br /&gt;
        -- otherwise, output an error message&lt;br /&gt;
        outputChatBox ( &amp;quot;There is no player named &amp;quot; .. targetPlayerName .. &amp;quot;!&amp;quot;, sourcePlayer )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
-- add our function as a handler for &amp;quot;hpslap&amp;quot;&lt;br /&gt;
addCommandHandler ( &amp;quot;hpslap&amp;quot;, hpSlap )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example 1&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example setting health by a command.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function Health(player, command, amount)&lt;br /&gt;
    setElementHealth(player, tonumber(amount))&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;set&amp;quot;, Health)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|414|Using setElementHealth on a dead ped makes it invincible}}&lt;br /&gt;
{{Issue|2223|setElementHealth in onClientPlayerDamage bug}}&lt;br /&gt;
{{Issue|472|setElementHealth in onClientPedDamage can cause crash}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementFrozen&amp;diff=73909</id>
		<title>SetElementFrozen</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementFrozen&amp;diff=73909"/>
		<updated>2022-01-30T18:10:05Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Updated issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function freezes an element (stops it in its position and disables movement) or unfreezes it.&lt;br /&gt;
{{Warning|This function cancels any animation set by setPedAnimation if you freeze the ped.}}&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 setElementFrozen ( element theElement, bool freezeStatus )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setFrozen|frozen|isElementFrozen}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] whose freeze status we want to change.&lt;br /&gt;
*'''freezeStatus:''' A boolean denoting whether we want to freeze (''true'') or unfreeze (''false'') it.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the element was frozen, ''false'' if it wasn't or if invalid arguments are passed.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Serverside example&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example binds the &amp;quot;p&amp;quot; key to a function to freeze/unfreeze the player's current vehicle.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function toggleFreezeStatus(thePlayer) -- This function freezes the specified player's vehicle, if he's in one&lt;br /&gt;
	local playerVehicle = getPedOccupiedVehicle(thePlayer) -- Check if player's in vehicle&lt;br /&gt;
&lt;br /&gt;
	if playerVehicle then -- if so&lt;br /&gt;
		local isPlayerVehicleFrozen = isElementFrozen(playerVehicle) -- Check if vehicle is frozen&lt;br /&gt;
&lt;br /&gt;
		setElementFrozen(playerVehicle, not isPlayerVehicleFrozen) -- Set opposite state&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local connectedPlayers = getElementsByType(&amp;quot;player&amp;quot;) -- Get all connected players&lt;br /&gt;
local playerElement = false -- Store reference to player&lt;br /&gt;
&lt;br /&gt;
for playerID = 1, #connectedPlayers do -- Loop through each player&lt;br /&gt;
	playerElement = connectedPlayers[playerID] -- Get player element by accessing it via playerID&lt;br /&gt;
&lt;br /&gt;
	bindKey(playerElement, &amp;quot;p&amp;quot;, &amp;quot;down&amp;quot;, toggleFreezeStatus, &amp;quot;Toggle freeze status&amp;quot;) -- Bind function for player&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;
==Issues==&lt;br /&gt;
{{Issues|&lt;br /&gt;
{{Issue|1291|Ped rotation is always zero on client side if ped has been frozed after creating it}}&lt;br /&gt;
{{Issue|541|Frozen ped rotation goes wrong with latency reduction enabled}}&lt;br /&gt;
{{Issue|442|Client-side setElementFrozen should sync vehicle driven by local player}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ar:SetElementFrozen]]&lt;br /&gt;
[[en:SetElementFrozen]]&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=73907</id>
		<title>SetElementData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetElementData&amp;diff=73907"/>
		<updated>2022-01-30T10:46:39Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed fixed issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server client function}}&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
This function stores [[element data]] under a certain key, attached to an element. Element data set using this is then synced with all clients and the server. The data can contain server created elements, but you should avoid passing data that is not able to be synced such as xmlnodes, acls, aclgroups etc.&lt;br /&gt;
&lt;br /&gt;
As element data is synced to all clients, it can generate a lot of network traffic and be heavy on performance. Events are much more efficient for sending data from a client to the server only, or from the server to a specific client. &amp;lt;br/&amp;gt;&lt;br /&gt;
Usage of element data should be disencouraged where your goal can be achieved with events like above, and [[table|tables]] for storing and retrieving data.&lt;br /&gt;
{{Tip|A simple and efficient way to make a variable known to the server and clients is to use setElementData on the [[root]] element.}}&lt;br /&gt;
{{Note|See [[Script security]] for tips on preventing cheaters when using events and element data}}&lt;br /&gt;
{{Note|For performance reasons, never use setElementData in events that fire often (like [[onClientRender]]) without further optimization or conditions. In fact, using element data in general can take such a toll on performance that not using it unless strictly neccesary (e.g use alternatives such as storing data in tables) is recommended.}}.&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0157|1.5.7-9.20477|A subscription mode has been introduced for [[setElementData]] serverside. When setting data in subscription mode, only clients that are added through [[addElementDataSubscriber]] will receive the data, which is good for performance.&lt;br /&gt;
Note this mode only works when setting element data serverside. Setting data clientside still sends the update to all clients if 'synchronize' is set to true.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setData||getElementData}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under. (Maximum 128 characters.) &lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''synchronize:''' Determines whether or not the data will be synchronized with the clients(server-side variation) or server(client-side variation)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set succesfully, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
{{New items|5.0157|1.5.7-9.20477|&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementData ( element theElement, string key, var value [, var syncMode=&amp;quot;broadcast&amp;quot;] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setData||getElementData}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under. (Maximum 31 characters.) &lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''syncMode:''' Synchronisation mode.&lt;br /&gt;
**''&amp;quot;broadcast&amp;quot;'' - Synchronise to all clients (default behavior). You can also parse ''true'' for this option.&lt;br /&gt;
**''&amp;quot;local&amp;quot;'' - Don't synchronise. You can also parse ''false'' for this option.&lt;br /&gt;
**''&amp;quot;subscribe&amp;quot;'' - Only synchronise to specific clients. See [[addElementDataSubscriber]] and [[removeElementDataSubscriber]].&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setElementData ( element theElement, string key, var value [, bool synchronize = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[element]]:setData||getElementData}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theElement:''' The [[element]] you wish to attach the data to.&lt;br /&gt;
*'''key:''' The key you wish to store the data under. (Maximum 31 characters.) &lt;br /&gt;
*'''value:''' The value you wish to store. See [[element data]] for a list of acceptable datatypes.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments=== &lt;br /&gt;
*'''synchronize:''' Determines whether or not the data will be synchronized with the server.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the data was set succesfully, ''false'' otherwise.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example allows a player to add a custom tag onto their nickname, and also reverts it back to normal if they wish.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function addPlayerCustomTag ( thePlayer, command, newTag )&lt;br /&gt;
	--Let's make sure the newTag param has been entered...&lt;br /&gt;
	if ( newTag ) then&lt;br /&gt;
		--Grab their current playername for saving.&lt;br /&gt;
		local sPlayerNickname = getPlayerName ( thePlayer )&lt;br /&gt;
		--Create their new nickname with their tag&lt;br /&gt;
		local sNewPlayerNickname = newTag .. &amp;quot; &amp;quot; .. sPlayerNickname&lt;br /&gt;
		&lt;br /&gt;
		--Let's first load the element data, see if it's there already&lt;br /&gt;
		--The reason for this is that if a player were to do /addtag twice,&lt;br /&gt;
		--the tag would be prepended a second time&lt;br /&gt;
		local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
		if ( sOldNick == false ) then&lt;br /&gt;
			--Save their orignal nickname in their element data&lt;br /&gt;
			setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, sPlayerNickname )&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		--Set their new nickname globally&lt;br /&gt;
		setPlayerName ( thePlayer, sNewPlayerNickname )&lt;br /&gt;
		&lt;br /&gt;
		--Tell them it's done&lt;br /&gt;
		outputChatBox ( &amp;quot;Your new nickname has been set, to put it back to its original state you can use /deltag&amp;quot;, thePlayer )&lt;br /&gt;
	else&lt;br /&gt;
		--The newTag param was not entered, give an error message&lt;br /&gt;
		outputChatBox ( &amp;quot;/addtag - Incorrect syntax, Correct: /addtag &amp;lt;newtag&amp;gt;&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;addtag&amp;quot;, addPlayerCustomTag )&lt;br /&gt;
&lt;br /&gt;
function removePlayerCustomTag ( thePlayer, command )&lt;br /&gt;
	--We first need to check that they have already used /addtag, let's do that now&lt;br /&gt;
	local sOldNick = getElementData( thePlayer, &amp;quot;tempdata.originalnick&amp;quot; )&lt;br /&gt;
	if ( sOldNick ) then&lt;br /&gt;
		--Great, they have a tag added, let's reset them&lt;br /&gt;
		&lt;br /&gt;
		--First we will want to reset the element data back to its default (that being false)&lt;br /&gt;
		setElementData ( thePlayer, &amp;quot;tempdata.originalnick&amp;quot;, false )&lt;br /&gt;
		&lt;br /&gt;
		--Now set the client name back&lt;br /&gt;
		setPlayerName( thePlayer, sOldNick )&lt;br /&gt;
		&lt;br /&gt;
		--Notify them&lt;br /&gt;
		outputChatBox ( &amp;quot;Your old nickname has been set&amp;quot;, thePlayer )&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler ( &amp;quot;deltag&amp;quot;, removePlayerCustomTag )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
[[tr:setElementData]]&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
[[pt-br:SetElementData]]&lt;br /&gt;
{{Element_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetCursorPosition&amp;diff=73906</id>
		<title>SetCursorPosition</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetCursorPosition&amp;diff=73906"/>
		<updated>2022-01-30T10:43:14Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed fixed issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function sets the current position of the mouse cursor.&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 setCursorPosition ( int cursorX, int cursorY )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
&amp;lt;!-- List each argument one per line. This should be the argument's name as in the argument list above, NOT the argument's data type --&amp;gt;&lt;br /&gt;
*'''cursorX:''' Position over the X axis&lt;br /&gt;
*'''cursorY:''' Position over the Y axis&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
&amp;lt;!-- Make this descriptive. Explain what cases will return false. If you're unsure, add a tag to it so we can check --&amp;gt;&lt;br /&gt;
Returns ''true'' if the position has been successfully set, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example sets your cursor position to the center of your screen after using the command ''cursorpos''.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function centerCursorFunction()&lt;br /&gt;
    local showing = isCursorShowing ()&lt;br /&gt;
    if showing then -- if the cursor is showing&lt;br /&gt;
        local screenX, screenY = guiGetScreenSize () --get the screen size in pixels&lt;br /&gt;
        setCursorPosition (screenX/2, screenY/2) --set the cursor position to the center of the screen&lt;br /&gt;
    else&lt;br /&gt;
        outputChatBox( &amp;quot;Your cursor is not showing.&amp;quot; )&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler( &amp;quot;cursorpos&amp;quot;, centerCursorFunction )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_input_functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setCursorPosition]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetChatAlpha&amp;diff=73905</id>
		<title>SetChatAlpha</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetChatAlpha&amp;diff=73905"/>
		<updated>2022-01-30T10:43:03Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed issues from disabled function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Disabled|This function doesn't exists. See issue 7698 on bugtracker.}}&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function sets the global alpha value of the in-game chat. The alpha value applies to text output, input line and background colors.&lt;br /&gt;
__NOTOC__ &lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setChatAlpha ( float alpha )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''alpha:''' the new global alpha value for the in-game chat (0-255)&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if alpha is a number and resides in a valid range (0-255), ''false'' if alpha is not a number or resides in an invalid range (like 9001).&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example makes everybodies chatbox flash in 1 second intervals.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local startTime = getTickCount()&lt;br /&gt;
local interval = 1000 -- time in milliseconds&lt;br /&gt;
local baseAlpha = 200 -- the alpha value the chat will at least have&lt;br /&gt;
                      -- valid: 0 - 255&lt;br /&gt;
&lt;br /&gt;
addEventHandler( &amp;quot;onClientRender&amp;quot;, root,&lt;br /&gt;
    function()&lt;br /&gt;
        local elapsedTime = getTickCount() - startTime&lt;br /&gt;
        local modAlpha = ( 255 - baseAlpha ) / 2&lt;br /&gt;
        local alpha = math.sin( elapsedTime / interval * math.pi * 2 ) * modAlpha&lt;br /&gt;
                      + baseAlpha + modAlpha&lt;br /&gt;
                      &lt;br /&gt;
        setChatAlpha( alpha )&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;
{{GUI_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetCameraTarget&amp;diff=73904</id>
		<title>SetCameraTarget</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetCameraTarget&amp;diff=73904"/>
		<updated>2022-01-30T10:42:46Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed fixed issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function allows you to set a player's camera to follow other elements instead. Currently supported element type is:&lt;br /&gt;
*[[Player]]s&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Server&amp;quot; class=&amp;quot;server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setCameraTarget ( player thePlayer [, player target = nil ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[player]]:setCameraTarget|cameraTarget|getCameraTarget}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''thePlayer:''' The player whose camera you wish to modify.&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''target:''' The player who you want the camera to follow. If none is specified, the camera will target the player.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client 1&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setCameraTarget ( player target )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''target:''' The player who you want the local camera to follow.&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{New feature/item|3.0132|1.3.1|5212|&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client 2&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This syntax mantains the player targeted by the camera, but makes the camera look at the specified coordinates. It has no effect when the camera doesn't have a target.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;bool setCameraTarget ( float targetX, float targetY, float targetZ )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''targetX, targetY, targetZ:''' The target position that you want the local camera to look at.&lt;br /&gt;
&amp;lt;/section&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the function was successful, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This is an example of how one could implement a spectator function. Using the left and right arrow keys you can view other players. Note that this code isn't complete as it doesn't take into account joining or quitting players.&lt;br /&gt;
&amp;lt;section class=&amp;quot;client&amp;quot; name=&amp;quot;Client script&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;
g_Players = getElementsByType(&amp;quot;player&amp;quot;)        -- get a list of all players in the server&lt;br /&gt;
for i,aPlayer in ipairs(g_Players) do          -- find out what index the local player has in the list&lt;br /&gt;
    if aPlayer == localPlayer then&lt;br /&gt;
        g_CurrentSpectated = i&lt;br /&gt;
        break&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function spectatePrevious()                    -- decrement the spectate index and spectate the corresponding player&lt;br /&gt;
     if g_CurrentSpectated == 1 then&lt;br /&gt;
         g_CurrentSpectated = #g_Players&lt;br /&gt;
     else&lt;br /&gt;
         g_CurrentSpectated = g_CurrentSpectated - 1&lt;br /&gt;
     end&lt;br /&gt;
    setCameraTarget(g_Players[g_CurrentSpectated])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function spectateNext()                        -- increment the spectate index and spectate the corresponding player&lt;br /&gt;
     if g_CurrentSpectated == #g_Players then&lt;br /&gt;
         g_CurrentSpectated = 1&lt;br /&gt;
     else&lt;br /&gt;
         g_CurrentSpectated = g_CurrentSpectated + 1&lt;br /&gt;
     end&lt;br /&gt;
    setCameraTarget(g_Players[g_CurrentSpectated])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Bind above functions to arrow keys&lt;br /&gt;
bindKey(&amp;quot;arrow_l&amp;quot;, &amp;quot;down&amp;quot;, spectatePrevious)&lt;br /&gt;
bindKey(&amp;quot;arrow_r&amp;quot;, &amp;quot;down&amp;quot;, spectateNext)&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;
{{Camera functions}}&lt;br /&gt;
&lt;br /&gt;
[[hu:setCameraTarget]]&lt;br /&gt;
[[RO:setCameraTarget]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetAccountData&amp;diff=73903</id>
		<title>SetAccountData</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAccountData&amp;diff=73903"/>
		<updated>2022-01-30T10:41:49Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed fixed issue&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Server function}}&lt;br /&gt;
__NOTOC__{{Important Note|You '''MUST''' use the standard ''module.key'' naming for your keys, as shown in the example below. This prevents collisions between different scripts.}}&lt;br /&gt;
This function sets a string to be stored in an [[account]]. This can then be retrieved using [[getAccountData]]. Data stored as account data is persistent across user's sessions and maps, unless they are logged into a guest account. Even if logged into a guest account, account data can be useful as a way to store a reference to your own account system, though it's persistence is equivalent to that of using [[setElementData]] on the player's element.&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool setAccountData ( account theAccount, string key, var value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||[[account]]:setData||getAccountData}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theAccount:''' The account you wish to retrieve the data from.&lt;br /&gt;
*'''key:''' The key under which you wish to store the data&lt;br /&gt;
*'''value:''' The value you wish to store. Set to false to remove the data. '''NOTE:''' you cannot store tables as values, but you can use [[toJSON]] strings.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a ''true'' if the account data was set, ''false'' if an invalid argument was specified.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
For a pirate roleplaying gametype, the amount of money a player has is made persistent by storing it in his account. Note the code uses &amp;quot;piraterpg.money&amp;quot; as key instead of just &amp;quot;money&amp;quot;, as the player may be participating in other gametypes that also save his money amount to his account. If both gametypes would use &amp;quot;money&amp;quot; as the account key, they'd overwrite each other's data.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function onPlayerQuit ( )&lt;br /&gt;
      -- when a player leaves, store his current money amount in his account data&lt;br /&gt;
      local playeraccount = getPlayerAccount ( source )&lt;br /&gt;
      if ( playeraccount ) and not isGuestAccount ( playeraccount ) then -- if the player is logged in&lt;br /&gt;
            local playermoney = getPlayerMoney ( source ) -- get the player money&lt;br /&gt;
            setAccountData ( playeraccount, &amp;quot;piraterpg.money&amp;quot;, playermoney ) -- save it in his account&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
function onPlayerLogin (_, playeraccount )&lt;br /&gt;
      -- when a player logins, retrieve his money amount from his account data and set it&lt;br /&gt;
      if ( playeraccount ) then&lt;br /&gt;
            local playermoney = getAccountData ( playeraccount, &amp;quot;piraterpg.money&amp;quot; )&lt;br /&gt;
            -- make sure there was actually a value saved under this key (check if playermoney is not false).&lt;br /&gt;
            -- this will for example not be the case when a player plays the gametype for the first time&lt;br /&gt;
            if ( playermoney ) then&lt;br /&gt;
                  setPlayerMoney ( source, playermoney )&lt;br /&gt;
            end&lt;br /&gt;
      end&lt;br /&gt;
end&lt;br /&gt;
 &lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerQuit&amp;quot;, root, onPlayerQuit )&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerLogin&amp;quot;, root, onPlayerLogin )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Account_functions}}&lt;br /&gt;
&lt;br /&gt;
[[en:setAccountData]]&lt;br /&gt;
[[ru:setAccountData]]&lt;br /&gt;
[[ar:setAccountData]]&lt;br /&gt;
[[es:setAccountData]]&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=RemoveResourceDefaultSetting&amp;diff=73902</id>
		<title>RemoveResourceDefaultSetting</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=RemoveResourceDefaultSetting&amp;diff=73902"/>
		<updated>2022-01-30T10:41:25Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Remove issue from deprecated function&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled|This function doesn't work actually. See [[#Issues|issues]] for more information.}}&lt;br /&gt;
This function is used to remove a default setting from specified [[resource]].&lt;br /&gt;
&amp;lt;!-- What are default settings? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Syntax== &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
bool removeResourceDefaultSetting ( resource theResource, string settingName ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''theResource:''' the resource which setting is to be removed&lt;br /&gt;
*'''settingName:''' name of the default setting which is to be removed&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the default setting was successfully removed, ''false'' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example would check if the server has the freeroam resource and removes the default settings called &amp;quot;spawnmaponstart&amp;quot;.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;addEventHandler(&amp;quot;onResourceStart&amp;quot;,resourceRoot,function()&lt;br /&gt;
	local freeroamRes = getResourceFromName(&amp;quot;Freeroam&amp;quot;)&lt;br /&gt;
	if(freeroamRes)then&lt;br /&gt;
		removeResourceDefaultSetting(freeroamRes,&amp;quot;spawnmaponstart&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
end)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Resource_functions}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnPlayerDamage&amp;diff=73901</id>
		<title>OnPlayerDamage</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnPlayerDamage&amp;diff=73901"/>
		<updated>2022-01-30T10:41:07Z</updated>

		<summary type="html">&lt;p&gt;Zangomangu: Removed fixed issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when a player is damaged, in any way.&lt;br /&gt;
&lt;br /&gt;
*This event is not triggered when attacked by a team member if friendly fire is enabled.&lt;br /&gt;
*Canceling this event has no effect. Cancel the client-side event [[onClientPlayerDamage]] instead.&lt;br /&gt;
*onPlayerDamage doesn't trigger if the damage kills the player, [[onPlayerWasted]] is called instead. &lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
player attacker, int damage_causing, int bodypart, float loss&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''attacker''': a [[player]] element representing the player who was the attacker.  If there was no attacker this returns false.&lt;br /&gt;
*'''damage_causing''': an [[int]] representing the cause of damage, either a [[Weapons|attacker weapon]], or some other [[Damage Types|types of damage]].&lt;br /&gt;
*'''bodypart''': an [[int]] representing the bodypart ID the player was hit on when he got damaged.&lt;br /&gt;
{{BodyParts}}&lt;br /&gt;
*'''loss''': a [[float]] representing the percentage of health the player lost.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[player]] who was damaged.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This example causes an instant kill when a player is shot in the head, and announces it in the chatbox.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function playerDamage_text ( attacker, weapon, bodypart, loss ) --when a player is damaged&lt;br /&gt;
	if ( bodypart == 9 and attacker and attacker ~= source ) then -- if the body part is 9 (head) and there is an attacker and it wasn't self damage&lt;br /&gt;
            outputChatBox ( &amp;quot;Headshot!&amp;quot;, attacker, 255, 170, 0 ) --output &amp;quot;Headshot&amp;quot; into the chatbox&lt;br /&gt;
	    killPed ( source, attacker, weapon, bodypart ) -- and kill the player&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler ( &amp;quot;onPlayerDamage&amp;quot;, root, playerDamage_text ) --add an event handler for the onPlayerDamage event&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{See also/Server event|Player events}}&lt;/div&gt;</summary>
		<author><name>Zangomangu</name></author>
	</entry>
</feed>