<?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=Danzy</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=Danzy"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Danzy"/>
	<updated>2026-04-17T09:25:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetPercentSubmerged&amp;diff=82380</id>
		<title>HandlingSetPercentSubmerged</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetPercentSubmerged&amp;diff=82380"/>
		<updated>2025-08-17T09:21:01Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete|Function has been removed}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Sets what percentage of the vehicle will be submerged if it enters water. A percentage of 0 means that it will stand on top of the water surface, a value of 100 means that it will immediately sink.&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 handlingSetPercentSubmerged ( handling theHandling, float percentage )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the submersion percentage.&lt;br /&gt;
*'''percentage:''' the submersion percentage, a value from 0-100.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetVehicleRotorState&amp;diff=82317</id>
		<title>SetVehicleRotorState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetVehicleRotorState&amp;diff=82317"/>
		<updated>2025-07-26T09:52:46Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &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|22862|&lt;br /&gt;
Turns the rotor on/off for an plane or helicopter. A vehicle with the rotor turned off cannot hover in the air.}}&lt;br /&gt;
&lt;br /&gt;
{{Note|The function should not be confused with [[setVehicleEngineState]].}}&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 setVehicleRotorState(vehicle theVehicle, bool state [, bool stopRotor = true ] )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[vehicle]]:setRotorState|rotorState|getVehicleRotorState}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle:''' The vehicle (helicopter or plane) whose rotor you want to toggle.&lt;br /&gt;
*'''state:''' The rotor state, which determines whether it should be on ('''true''') or off ('''false''').&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''stopRotor:''' Specifies whether the rotor should be stopped after being turned off. If false, the rotor will continue spinning at a constant speed (it won't slow down or accelerate). It will also not be able to lift off the ground. You can also use [[setVehicleRotorSpeed]] to manage the rotor speed.&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;
&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 add a command called '/rotorstart' that will either shut your vehicle's rotors off or start them up again. Do note that once rotors are stopped you will simply fall from the sky.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function rotorStartStop()&lt;br /&gt;
    -- We need to check if the player is in a vehicle, and whether or not it is a plane or helicopter&lt;br /&gt;
    local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
    if (not vehicle or (getVehicleType(vehicle) ~= &amp;quot;Helicopter&amp;quot; and getVehicleType(vehicle) ~= &amp;quot;Plane&amp;quot;)) then&lt;br /&gt;
        outputChatBox(&amp;quot;You are not in a plane or helicopter!&amp;quot;, 255, 0, 0)&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    -- Set the rotor state depending on previous state and give a message&lt;br /&gt;
    local rotorState = getVehicleRotorState(vehicle)&lt;br /&gt;
    if (rotorState) then&lt;br /&gt;
        setVehicleRotorState(vehicle, false)&lt;br /&gt;
        outputChatBox(&amp;quot;Your vehicle's rotor has been stopped, you will now drop out of the sky!&amp;quot;, 255, 0, 0)&lt;br /&gt;
    else&lt;br /&gt;
        setVehicleRotorState(vehicle, true)&lt;br /&gt;
        outputChatBox(&amp;quot;Your vehicle's rotor has been started up, fly away!&amp;quot;, 0, 255, 0)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;rotorstart&amp;quot;, rotorStartStop) -- Add our command handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetTractionMultiplier&amp;diff=82316</id>
		<title>HandlingSetTractionMultiplier</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetTractionMultiplier&amp;diff=82316"/>
		<updated>2025-07-26T09:43:06Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Sets the traction multiplier of a handling element. Low values will result in slippery tires, high values give good grip.&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 handlingSetTractionMultiplier ( handling theHandling, float traction )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the traction multiplier.&lt;br /&gt;
*'''traction:''' the traction multiplier to set.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionHighSpeedDamping&amp;diff=82315</id>
		<title>HandlingSetSuspensionHighSpeedDamping</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionHighSpeedDamping&amp;diff=82315"/>
		<updated>2025-07-26T09:42:43Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Sets the high speed suspension force of a handling 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 handlingSetSuspensionHighSpeedDamping ( handling theHandling, float damping )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the high speed suspension damping strength.&lt;br /&gt;
*'''damping:''' the high speed damping strength to set.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionAntidiveMultiplier&amp;diff=82314</id>
		<title>HandlingSetSuspensionAntidiveMultiplier</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionAntidiveMultiplier&amp;diff=82314"/>
		<updated>2025-07-26T09:42:10Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Sets the suspension antidive multiplier of a handling 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 handlingSetSuspensionAntidiveMultiplier ( handling theHandling, float antidive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the suspension antidive multiplier.&lt;br /&gt;
*'''antidive:''' the antidive multiplier to set.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionDamping&amp;diff=82313</id>
		<title>HandlingSetSuspensionDamping</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionDamping&amp;diff=82313"/>
		<updated>2025-07-26T09:42:03Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Sets the suspension damping strength of a handling 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 handlingSetSuspensionDamping ( handling theHandling, float damping )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the suspension damping strength.&lt;br /&gt;
*'''damping:''' the damping strength to set.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionDamping&amp;diff=82312</id>
		<title>HandlingSetSuspensionDamping</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionDamping&amp;diff=82312"/>
		<updated>2025-07-26T09:41:44Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Sets the suspension damping strength of a handling 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 handlingSetSuspensionDamping ( handling theHandling, float damping )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the suspension damping strength.&lt;br /&gt;
*'''damping:''' the damping strength to set.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionAntidiveMultiplier&amp;diff=82311</id>
		<title>HandlingSetSuspensionAntidiveMultiplier</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetSuspensionAntidiveMultiplier&amp;diff=82311"/>
		<updated>2025-07-26T09:41:02Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Sets the suspension antidive multiplier of a handling 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 handlingSetSuspensionAntidiveMultiplier ( handling theHandling, float antidive )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the suspension antidive multiplier.&lt;br /&gt;
*'''antidive:''' the antidive multiplier to set.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetPercentSubmerged&amp;diff=82310</id>
		<title>HandlingSetPercentSubmerged</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetPercentSubmerged&amp;diff=82310"/>
		<updated>2025-07-26T09:38:10Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete|Function has been removed}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Sets what percentage of the vehicle will be submerged if it enters water. A percentage of 0 means that it will stand on top of the water surface, a value of 100 means that it will immediately sink.&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 handlingSetPercentSubmerged ( handling theHandling, float percentage )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the submersion percentage.&lt;br /&gt;
*'''percentage:''' the submersion percentage, a value from 0-100.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Needs Example]]&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetDriveType&amp;diff=82309</id>
		<title>HandlingSetDriveType</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetDriveType&amp;diff=82309"/>
		<updated>2025-07-26T09:37:35Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete|Function has been removed}}&lt;br /&gt;
{{Deprecated|setVehicleHandling}}&lt;br /&gt;
Sets the drive type of a handling 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 handlingSetDriveType ( handling theHandling, string driveType )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to change the drive type.&lt;br /&gt;
*'''driveType:''' one of the following strings:&lt;br /&gt;
**'''rwd''' - rear wheel driven&lt;br /&gt;
**'''fwd''' - front wheel driven&lt;br /&gt;
**'''awd''' - all wheel driven&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&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;
{{Handling_functions}}&lt;br /&gt;
[[Category:Archived]]&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingSetABS&amp;diff=82308</id>
		<title>HandlingSetABS</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingSetABS&amp;diff=82308"/>
		<updated>2025-07-26T09:37:25Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete|Function has been removed}}&lt;br /&gt;
{{Deprecated|setVehicleHandling}}&lt;br /&gt;
Turns ABS on or off for a handling 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 handlingSetABS ( handling theHandling, bool ABS )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to toggle the ABS.&lt;br /&gt;
*'''ABS:''' ''true'' to turn ABS on, ''false'' to turn it off.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' on success, ''false'' in case of failure.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function turnABS(thePlayer)&lt;br /&gt;
	local theVehicle = getPedOccupiedVehicle(thePlayer) -- Get thePlayer vehicle&lt;br /&gt;
	if not theVehicle then return end -- if the player is not in the vehicle then cancel&lt;br /&gt;
		local ABS = getVehicleHandlingProperty(theVehicle,&amp;quot;ABS&amp;quot;) -- We will use the additional function that you will find under this one. That will be more convenient.&lt;br /&gt;
		if ABS == true then -- Check, if ABS is turn on then turn its off.&lt;br /&gt;
			setVehicleHandling(theVehicle,&amp;quot;ABS&amp;quot;,false)&lt;br /&gt;
			outputChatBox(&amp;quot;You turn off ABS&amp;quot;,thePlayer)&lt;br /&gt;
		else -- ABS is off. Turn on this.&lt;br /&gt;
	setVehicleHandling(theVehicle,&amp;quot;ABS&amp;quot;,true)&lt;br /&gt;
	outputChatBox(&amp;quot;You turn on ABS&amp;quot;,thePlayer)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
	addCommandHandler(&amp;quot;ABS&amp;quot;,turnABS)&lt;br /&gt;
	&lt;br /&gt;
	function getVehicleHandlingProperty ( element, property )&lt;br /&gt;
    if isElement ( element ) and getElementType ( element ) == &amp;quot;vehicle&amp;quot; and type ( property ) == &amp;quot;string&amp;quot; then -- Make sure there's a valid vehicle and a property string&lt;br /&gt;
        local handlingTable = getVehicleHandling ( element ) -- Get the handling as table and save as handlingTable&lt;br /&gt;
        local value = handlingTable[property] -- Get the value from the table&lt;br /&gt;
        &lt;br /&gt;
        if value then -- If there's a value (valid property) &lt;br /&gt;
			return value -- Return it&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return false -- Not an element, not a vehicle or no valid property string. Return failure&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Handling_functions}}&lt;br /&gt;
[[Category:Archived]]&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingGetTractionBias&amp;diff=82307</id>
		<title>HandlingGetTractionBias</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingGetTractionBias&amp;diff=82307"/>
		<updated>2025-07-26T09:37:12Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete|Function has been removed}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Returns the traction bias of a handling element or vehicle ID. This determines how the grip is distributed over the front and back tires.&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 handlingGetTractionBias ( handling theHandling )&lt;br /&gt;
float handlingGetTractionBias ( int vehicleID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to get the traction bias, ''or''&lt;br /&gt;
*'''vehicleID:''' the vehicle ID of which you want to get the traction bias.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If you specified a handling element, returns its traction bias if one is set, or ''nil'' otherwise. If you specified a vehicle ID, returns the traction bias that currently applies to vehicles of that ID. Returns ''false'' in case of failure.&lt;br /&gt;
&lt;br /&gt;
The traction bias is a number between 0 and 1. If it is 0, the back tires have all the grip and the front have none. If it is 1, only the front tires have grip. A value of 0.5 will give both tires the same amount of grip.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingGetSuspensionFrontRearBias&amp;diff=82306</id>
		<title>HandlingGetSuspensionFrontRearBias</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingGetSuspensionFrontRearBias&amp;diff=82306"/>
		<updated>2025-07-26T09:36:36Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete|Function has been removed}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Returns the suspension bias of a handling element or vehicle ID.&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 handlingGetSuspensionFrontRearBias ( handling theHandling )&lt;br /&gt;
float handlingGetSuspensionFrontRearBias ( int vehicleID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to get the suspension bias, ''or''&lt;br /&gt;
*'''vehicleID:''' the vehicle ID of which you want to get the suspension bias.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If you specified a handling element, returns its suspension bias if one is set, or ''nil'' otherwise. If you specified a vehicle ID, returns the suspension bias that currently applies to vehicles of that ID. Returns ''false'' in case of failure.&lt;br /&gt;
&lt;br /&gt;
The suspension bias is a number between 0 and 1. If it's 0, the back tires have all the suspension and the front tires have none. If it's 1, the front tires have suspension and the back tires have none. If it's 0.5, front and back tires have the same suspension strength.&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;
{{Handling_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingGetCenterOfMass&amp;diff=82305</id>
		<title>HandlingGetCenterOfMass</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingGetCenterOfMass&amp;diff=82305"/>
		<updated>2025-07-26T09:35:06Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete|Function has been removed}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Returns the center of mass of a handling element or vehicle ID. This is a 3D vector relative to the center of the mesh.&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 handlingGetCenterOfMass ( handling theHandling )&lt;br /&gt;
float float float handlingGetCenterOfMass ( int vehicleID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you wish to get the center of mass, ''or''&lt;br /&gt;
*'''int vehicleID:''' the vehicle ID of which you want to get the center of mass.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If you specified a handling element, returns the x, y and z components of the center of mass vector of the handling element if it is set, or ''nil'' if not. If you specified a vehicle ID, returns the x, y, and z components of the center of mass that currently applies to vehicles of that ID. Returns ''false'' in case of failure.&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;
{{Handling_functions}}&lt;br /&gt;
[[Category:Archived]]&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=HandlingGetBrakeBias&amp;diff=82304</id>
		<title>HandlingGetBrakeBias</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=HandlingGetBrakeBias&amp;diff=82304"/>
		<updated>2025-07-26T09:34:42Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server function}}&lt;br /&gt;
{{Disabled}}&lt;br /&gt;
{{Delete|Function has been removed}}&lt;br /&gt;
{{Deprecated|getVehicleHandling}}&lt;br /&gt;
Returns the brake bias of a handling element or vehicle ID (the distribution of the braking power over the front and back tires).&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 handlingGetBrakeBias ( handling theHandling )&lt;br /&gt;
float handlingGetBrakeBias ( int vehicleID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theHandling:''' the handling of which you want to get the brake bias, ''or''&lt;br /&gt;
*'''vehicleID:''' the vehicle ID of which you want to get the brake bias.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
If you specified a handling element, returns its brake bias if one is set, or ''nil'' otherwise. If you specified a vehicle ID, returns the brake bias that currently applies to vehicles of that ID. Returns ''false'' in case of failure.&lt;br /&gt;
&lt;br /&gt;
The brake bias is a value between 0 and 1. 0 means the car only brakes on its back tires, 1 that it only brakes on the front tires. 0.5 means that front and back tires brake with the same strength.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Handling_functions}}&lt;br /&gt;
[[Category:Archived]]&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=EngineResetModelLODDistance&amp;diff=82303</id>
		<title>EngineResetModelLODDistance</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=EngineResetModelLODDistance&amp;diff=82303"/>
		<updated>2025-07-26T09:32:54Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Client function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{New feature/item|3.0158|1.5.7|20383|This function resets the LOD distance for an object / model ID.}}&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 engineResetModelLODDistance ( int model ) &lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
{{OOP||Engine.resetModelLODDistance}}&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''model:''' The model / object ID number you want to reset the LOD distance of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the LOD distance was reset to default, or ''false'' if the model argument is incorrect, or the LOD distance hasn't been changed.&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 code will reset all script spawned objects' LOD distances. It also implements a counter which will show how many objects have been affected by this script.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function resetLODs()&lt;br /&gt;
    local count = 0 -- We add a counter for debug message&lt;br /&gt;
    for ind, obj in ipairs(getElementsByType(&amp;quot;object&amp;quot;)) do&lt;br /&gt;
        -- Get model, and reset it's LOD distance&lt;br /&gt;
        local model = getElementModel(obj)&lt;br /&gt;
        engineResetModelLODDistance(model)&lt;br /&gt;
        -- Add one to counter&lt;br /&gt;
        count = count + 1&lt;br /&gt;
    end&lt;br /&gt;
    outputDebugString(&amp;quot;Reset LOD model distance for &amp;quot;..count..&amp;quot; objects&amp;quot;, 3)&lt;br /&gt;
end&lt;br /&gt;
addEventHandler(&amp;quot;onClientResourceStart&amp;quot;, resourceRoot, resetLODs) -- We run this only when this resource (re)starts&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;
{{Engine_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerTargetStart&amp;diff=82298</id>
		<title>GetPlayerTargetStart</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerTargetStart&amp;diff=82298"/>
		<updated>2025-07-25T22:06:04Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
{{Deprecated|getPedTargetStart|}}&lt;br /&gt;
&lt;br /&gt;
This function allows retrieval of the position a player's target range begins, when he is aiming with a weapon.&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 getPlayerTargetStart ( player targetingPlayer )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
===Required Arguments=== &lt;br /&gt;
*'''targetingPlayer:''' The player whose target start you wish to retrieve&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns three floats, x,y,z, representing the position where the player's target starts, or false if it was unsuccessful.&lt;br /&gt;
&lt;br /&gt;
==Example== &lt;br /&gt;
This page does not have an 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;
{{Player_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVehicleRotorState&amp;diff=82297</id>
		<title>GetVehicleRotorState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVehicleRotorState&amp;diff=82297"/>
		<updated>2025-07-25T22:04:50Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &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|22862|This function returns a vehicle's (plane or helicopter) rotor state (on or off).}}&lt;br /&gt;
&lt;br /&gt;
{{Note|The function should not be confused with [[getVehicleEngineState]].}}&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 getVehicleRotorState ( vehicle theVehicle )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{OOP||[[vehicle]]:getRotorState|rotorState|setVehicleRotorState}}&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''theVehicle''': the [[vehicle]] you wish to get the engine state of.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns '''true''' if the vehicle's rotor is started, '''false''' otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This code adds a simple command that allows you to check a vehicle's rotor state keeping in mind you have to be in either a plane or helicopter.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function checkRotor()&lt;br /&gt;
    -- We need to check if the player is in a vehicle, and whether or not it is a plane or helicopter&lt;br /&gt;
    local vehicle = getPedOccupiedVehicle(localPlayer)&lt;br /&gt;
    if (not vehicle or (getVehicleType(vehicle) ~= &amp;quot;Helicopter&amp;quot; and getVehicleType(vehicle) ~= &amp;quot;Plane&amp;quot;)) then&lt;br /&gt;
        outputChatBox(&amp;quot;You are not in a plane or helicopter!&amp;quot;, 255, 0, 0)&lt;br /&gt;
        return false&lt;br /&gt;
    end&lt;br /&gt;
    -- And now we show rotor state using a neat ternary expression&lt;br /&gt;
    local rotorState = getVehicleRotorState(vehicle)&lt;br /&gt;
    outputChatBox(&amp;quot;Your vehicle's rotor is &amp;quot;..(rotorState and &amp;quot;spinning&amp;quot; or &amp;quot;stopped&amp;quot;)..&amp;quot;!&amp;quot;, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;rotor&amp;quot;, checkRotor)&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 vehicle functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetVersion&amp;diff=82296</id>
		<title>GetVersion</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetVersion&amp;diff=82296"/>
		<updated>2025-07-25T21:53:51Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
&lt;br /&gt;
This function gives you various version information about MTA and the operating system.&lt;br /&gt;
&lt;br /&gt;
MTA already has a built in command '/ver' which will show you your client version. Alongside that, there is also '/sver' which will show you the version of the server you are currently connected to. This function unlike [[getPlayerVersion]] shows a lot more information regarding MTA version.&lt;br /&gt;
{{Note|Clientside will return the version from the player, and the server-sided will return version from the server.}}&lt;br /&gt;
{{Note|Current MTA version: {{CurrentVersion}}}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;table getVersion ( )&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns a table with version information. Specifically these keys are present in the table:&lt;br /&gt;
*'''number:''' the MTA server or client version (depending where the function was called) in pure numerical form, e.g. ''&amp;quot;256&amp;quot;''&lt;br /&gt;
*'''mta:''' the MTA server or client version (depending where the function was called) in textual form, e.g. ''&amp;quot;1.0&amp;quot;''&lt;br /&gt;
*'''name:''' the full MTA product name, either ''&amp;quot;MTA:SA Server&amp;quot;'' or ''&amp;quot;MTA:SA Client&amp;quot;''.&lt;br /&gt;
*'''netcode:''' the netcode version number.&lt;br /&gt;
*'''os:''' returns the operating system on which the server or client is running&lt;br /&gt;
*'''type:''' the type of build.  can be:&lt;br /&gt;
**'''&amp;quot;Nightly rX&amp;quot;''' - A nightly development build.  '''X''' represents the nightly build revision.&lt;br /&gt;
**'''&amp;quot;Custom&amp;quot;''' - A build compiled manually&lt;br /&gt;
**'''&amp;quot;Release&amp;quot;''' - A build that is publicly released (provisional).&lt;br /&gt;
*'''tag:''' the build tag (from 1.0.3 onwards). Contains infomation about the underlying version used. i.e. The final version of 1.0.3 has the build tag of &amp;quot;1.0.3 rc-9&amp;quot;. (This can be confirmed by using the console command 'ver'.)&lt;br /&gt;
*'''sortable:''' a 15 character sortable version string (from 1.0.4 onwards). Format of the string is described in [[getPlayerVersion]].&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 piece of code shows how you can use a simple command and a for loop to dump the output into chatbox, whilst capitalizing 1st character for extra bonus.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showVersion(player)&lt;br /&gt;
    -- We use a for loop to dump the output into player chatbox&lt;br /&gt;
    outputChatBox(&amp;quot;Version information (Server):&amp;quot;, player, 0, 255, 0)&lt;br /&gt;
    for ind, dat in pairs(getVersion()) do&lt;br /&gt;
        -- Uppercasing first letter too&lt;br /&gt;
        outputChatBox(string.upper(string.sub(ind, 1, 1))..string.sub(ind, 2)..&amp;quot;: &amp;quot;..dat, player, 0, 255, 0)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;version&amp;quot;, showVersion) -- Define our command handler&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;Client&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This piece of code shows how you can use a simple command and a for loop to dump the output into chatbox, whilst capitalizing 1st character for extra bonus. Keep in mind that this is the client sided version of this command which will output version information of your client, whilst the example above outputs information of the server you are connected to.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showVersion()&lt;br /&gt;
    -- We use a for loop to dump the output into player chatbox&lt;br /&gt;
    outputChatBox(&amp;quot;Version information (Client):&amp;quot;, 0, 255, 0)&lt;br /&gt;
    for ind, dat in pairs(getVersion()) do&lt;br /&gt;
        -- Uppercasing first letter too&lt;br /&gt;
        outputChatBox(string.upper(string.sub(ind, 1, 1))..string.sub(ind, 2)..&amp;quot;: &amp;quot;..dat, 0, 255, 0)&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;version&amp;quot;, showVersion) -- Define our command handler&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;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Compatibility_FAQ&amp;diff=77548</id>
		<title>Compatibility FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Compatibility_FAQ&amp;diff=77548"/>
		<updated>2023-09-02T13:18:08Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Compatibility Comparison ==&lt;br /&gt;
{{Warning|Using the legacy build is not without risk, there are known security issues in the Chrome Embedded Framework (CEF) that MTA:SA 1.5.7 uses for Windows XP and Vista. It is recommended that you upgrade from XP or Vista to a supported Windows version. (Windows XP and Vista are no longer supported by MTA after September 2019.) |true}} &lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operating System&lt;br /&gt;
! Service Pack/Version &lt;br /&gt;
! Release Date&lt;br /&gt;
! Supported by Microsoft&amp;lt;ref&amp;gt;https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet&amp;lt;/ref&amp;gt;&lt;br /&gt;
! Does MTA:SA {{Current Version|full}} work?&lt;br /&gt;
! Chrome Embedded Framework&lt;br /&gt;
Updates&lt;br /&gt;
! Future MTA:SA&lt;br /&gt;
releases/updates&lt;br /&gt;
|-&lt;br /&gt;
| Windows XP&lt;br /&gt;
| Service Pack 3&lt;br /&gt;
| August 2001&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No|1.5.7 was the last version}}&lt;br /&gt;
|-&lt;br /&gt;
| Windows Vista&lt;br /&gt;
| Service Pack 2&lt;br /&gt;
| November 2006&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{No|1.5.7 was the last version}}&lt;br /&gt;
|-&lt;br /&gt;
| Windows 7&lt;br /&gt;
| Service Pack 1&lt;br /&gt;
| July 2009&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
| Windows 8.0&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| August 2012&lt;br /&gt;
| {{No|No, upgrade to 8.1&amp;lt;ref&amp;gt;https://support.microsoft.com/en-us/help/15288/windows-8-update-to-windows-8-1&amp;lt;/ref&amp;gt;}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| Windows 8.1&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| August 2013&lt;br /&gt;
| {{No|No, upgrade to 10}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=12 | Windows 10&amp;lt;ref&amp;gt;([https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet])&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 1507&lt;br /&gt;
| July 2015&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 1511&lt;br /&gt;
| November 2015&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 1607&lt;br /&gt;
| August 2016&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 1703&lt;br /&gt;
| April 2017&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 1709&lt;br /&gt;
| October 2017&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 1803&lt;br /&gt;
| April 2018&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 1809&lt;br /&gt;
| September 2018&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 1903&lt;br /&gt;
| May 2019&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 1909&lt;br /&gt;
| November 2019&lt;br /&gt;
| {{No}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|-&lt;br /&gt;
| 2004&lt;br /&gt;
| May 2020&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
| 20H2&lt;br /&gt;
| October 2020&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
| 21H1&lt;br /&gt;
| May 2021&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
| {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
|rowspan=1 | Windows 11&amp;lt;ref&amp;gt;([https://support.microsoft.com/en-us/help/13853/windows-lifecycle-fact-sheet])&amp;lt;/ref&amp;gt;&lt;br /&gt;
| 21H2&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
| {{n/a}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Please use a supported version of Windows 10 to run MTA.&lt;br /&gt;
* There are no guarantees that MTA will work on older not by Microsoft supported Windows 8 and 10 versions.&lt;br /&gt;
&lt;br /&gt;
== FAQ - Frequently Asked Questions ==&lt;br /&gt;
=== Google is dropping XP/Vista support for Chrome browser? What does this even have to do with MTA:SA? ===&lt;br /&gt;
As you may know from our previous [https://forum.mtasa.com/topic/75559-mtasa-15-release-candidate-is-ready-for-testing/ news posts], MTA:SA uses CEF (Chrome Embedded Framework) components for providing some functionality for the mod since version 1.5. Being Chromium-based, CEF components are also being phased out for users of older Operating Systems and will simply not work on them.&amp;lt;ref&amp;gt;https://bitbucket.org/chromiumembedded/cef&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Does MTA:SA 1.5.7 work fine on Windows XP and Windows Vista? ===&lt;br /&gt;
Yes, it works fine if you install it through the legacy build. We still can not really recommend using these systems anymore due to the reasons listed below.&lt;br /&gt;
&lt;br /&gt;
CEF compatibility issue aside, these Operating Systems (XP especially) are really old nowadays. You are putting yourself at risk if you use them as they are either no longer supported by Microsoft (XP) or the support will be discontinued soon (April 2017 - Vista).&lt;br /&gt;
&lt;br /&gt;
=== What will happen if I try to use the regular build of 1.5.7 on Windows XP/Vista? ===&lt;br /&gt;
MTA:SA installer will display an error and will not let you install the mod on such systems. You will be asked to download the legacy build from our website.&lt;br /&gt;
&lt;br /&gt;
=== And what will happen if I try to use the legacy build of 1.5.7 on Windows 7 and above? ===&lt;br /&gt;
Similarly, MTA:SA installer will display an error and will not let you install the mod on such systems. You will be asked to download the regular build from our website.&lt;br /&gt;
&lt;br /&gt;
=== Why couldn't you just stick to the older version of CEF then so that XP/Vista would be still supported? / What about releasing two versions of the mod? A regular one with newest CEF and a legacy one with the older CEF build that still works on XP/Vista?  ===&lt;br /&gt;
Hey, but we actually do provide a legacy build for MTA:SA 1.5.7 for XP/Vista users with an older version of CEF components.&lt;br /&gt;
&lt;br /&gt;
The problem with sticking with either of these options is that we would have to continue providing a version that is vulnerable to any present and future security exploits that exist in Chromium and are already widely used. We do not want to put our users at risk because of that. CEF developers themselves do not want to provide long-term security support for such a build either. &amp;lt;ref&amp;gt;http://www.magpcss.org/ceforum/viewtopic.php?f=6&amp;amp;t=14187&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== I am playing the mod on Windows 7/Windows 8/Windows 8.1/Windows 10 or newer. Am I affected by this?  ===&lt;br /&gt;
No, you will not be affected at all. In fact, you will have a better experience with built-in web browser components than before due to security and performance fixes included in the newer CEF versions.&lt;br /&gt;
&lt;br /&gt;
=== I am using Windows XP/Vista and I would still like to play future versions of MTA:SA. What can I do about it? ===&lt;br /&gt;
If you are using Windows XP or Windows Vista, you should upgrade your OS to a newer one. You will likely be required to do a clean install for that, so back up your stuff first. You should use these tools first to see if your PC is capable of upgrading to newer OS:&lt;br /&gt;
&lt;br /&gt;
    Windows 7: [https://www.microsoft.com/en-us/download/details.aspx?id=20 Windows 7 Upgrade Advisor]&lt;br /&gt;
    Windows 8/10: [http://go.microsoft.com/fwlink?linkid=259439 Windows 8 Upgrade Assistant]&lt;br /&gt;
&lt;br /&gt;
Is your PC toaster-tier which does not support Windows 8 or even 7? That means it is probably the right time to buy something more modern.&lt;br /&gt;
&lt;br /&gt;
But fear not, if you are already using Windows 7 or newer, just install the newest build of MTA:SA 1.5.7 and you are set! And if you don't want to upgrade your OS or PC, well, we will keep offering the legacy build that works on XP/Vista for a while...&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [https://forum.mtasa.com/topic/89685-mtasa-windows-xpvista-cef-components-and-you/ Topic about the compatibility changes]&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ClearDebugBox&amp;diff=72902</id>
		<title>ClearDebugBox</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ClearDebugBox&amp;diff=72902"/>
		<updated>2021-10-12T09:35:10Z</updated>

		<summary type="html">&lt;p&gt;Danzy: /* Example */&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|20854|This function clears the debug box.}}&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 clearDebugBox ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Always returns ''true''.&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 clears the debug window when any new debug message is displayed:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler (&amp;quot;onClientDebugMessage&amp;quot;, root,&lt;br /&gt;
    function ()&lt;br /&gt;
         clearDebugBox ()&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.5.8-9.20854|}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_output_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=GetPlayerMapOpacity&amp;diff=72901</id>
		<title>GetPlayerMapOpacity</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=GetPlayerMapOpacity&amp;diff=72901"/>
		<updated>2021-10-12T09:31:56Z</updated>

		<summary type="html">&lt;p&gt;Danzy: /* Example */&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|20945|This function allows to get the opacity of the radar map (F11).}}&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
int getPlayerMapOpacity ( )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{OOP||[[player]].getMapOpacity}}&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns an [[integer]] with a value from 0 to 255, where 0 is fully transparent and 255 is fully opaque.&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 implements a command that tells you what your current map opacity is.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function showMapOpacity()&lt;br /&gt;
	-- We get the map opacity value&lt;br /&gt;
	local mapOpacity = getPlayerMapOpacity()&lt;br /&gt;
	-- We tell what the map opacity is to the player&lt;br /&gt;
	outputChatBox(&amp;quot;Your map's opacity is at &amp;quot;..mapOpacity, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;mapopacity&amp;quot;, showMapOpacity)&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.5.8-9.20945}}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client_player_functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=ResetAmbientSounds&amp;diff=61708</id>
		<title>ResetAmbientSounds</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=ResetAmbientSounds&amp;diff=61708"/>
		<updated>2018-12-21T22:48:57Z</updated>

		<summary type="html">&lt;p&gt;Danzy: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
{{Client function}}&lt;br /&gt;
This function is used to reset the background sounds to the default setting.&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 resetAmbientSounds()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true if the ambient sounds were reset, false otherwise.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function resetAmbient() &lt;br /&gt;
	resetAmbientSounds() --This will reset the Ambient Sounds of the game&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;resetambient&amp;quot;, resetAmbient) -- If you use this command it would trigger the resetAmbient function&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client world functions}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=OnElementClicked&amp;diff=58513</id>
		<title>OnElementClicked</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=OnElementClicked&amp;diff=58513"/>
		<updated>2018-08-22T18:46:59Z</updated>

		<summary type="html">&lt;p&gt;Danzy: /* Examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server event}}&lt;br /&gt;
This event is triggered when an element is clicked on by the client. These events can only trigger when the client has its cursor enabled. It triggers for all three mousebuttons in both their up and down states.&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
string mouseButton, string buttonState, player playerWhoClicked, float clickPosX, float clickPosY, float clickPosZ&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*'''mouseButton''': a [[string]] representing the mouse button that was clicked. This might be ''left'', ''middle'' or ''right''.&lt;br /&gt;
*'''buttonState''': a [[string]] representing what state the button clicked is in. This might be ''up'' or ''down''.&lt;br /&gt;
*'''playerWhoClicked''': the [[player]] that clicked on the [[element]].&lt;br /&gt;
*'''clickPosX''': the X position in the world the [[player]] clicked at.&lt;br /&gt;
*'''clickPosY''': the Y position in the world the [[player]] clicked at.&lt;br /&gt;
*'''clickPosZ''': the Z position in the world the [[player]] clicked at.&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
The [[event system#Event source|source]] of this event is the [[element]] that got clicked by the player.&lt;br /&gt;
&lt;br /&gt;
==Examples== &lt;br /&gt;
This example prints type of the element you clicked to chatbox when you click it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function elementClicked( theButton, theState, thePlayer )&lt;br /&gt;
    if theButton == &amp;quot;left&amp;quot; and theState == &amp;quot;down&amp;quot; then -- if left mouse button was pressed down&lt;br /&gt;
        outputChatBox( &amp;quot;You clicked &amp;quot; .. getElementType( source ), thePlayer ) -- print the element type to players chatbox&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onElementClicked&amp;quot;, root, elementClicked ) -- add a handler function for the event&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example check if the clicked element is a vehicle. If is, then repairs it.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function repairClickedVehicle( button, state, player ) -- Add the function&lt;br /&gt;
    if button == &amp;quot;left&amp;quot; and state == &amp;quot;down&amp;quot; then&lt;br /&gt;
        if getElementType( source ) == &amp;quot;vehicle&amp;quot; then -- If the clicked element is a vehicle...&lt;br /&gt;
            local x, y, z = getElementPosition( player )&lt;br /&gt;
            local x1, y1, z1 = getElementPosition( source ) &lt;br /&gt;
            local distance = getDistanceBetweenPoints3D( x, y, z, x1, y1, z1 ) -- Some distance calculations&lt;br /&gt;
            if distance &amp;lt; 4 then -- Check if the player is near the vehicle&lt;br /&gt;
                if getElementHealth( source ) &amp;lt; 1000 then&lt;br /&gt;
                    fixVehicle( source )&lt;br /&gt;
                    outputChatBox( &amp;quot;You have repaired a &amp;quot;..getVehicleNameFromModel( getElementModel( source ) ), player, 0, 255, 0 )&lt;br /&gt;
                else&lt;br /&gt;
                    outputChatBox( &amp;quot;Vehicle is not damaged!&amp;quot;, player, 255, 0, 0 )&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
addEventHandler( &amp;quot;onElementClicked&amp;quot;, root, repairClickedVehicle ) -- Add the event handler&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{See also/Server event|Element events}}&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWeather&amp;diff=58497</id>
		<title>SetWeather</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWeather&amp;diff=58497"/>
		<updated>2018-08-21T19:09:00Z</updated>

		<summary type="html">&lt;p&gt;Danzy: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the current [[weather]] to the given valid value. To change the weather gradually, see [[setWeatherBlended]].&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 setWeather ( int weatherID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''weatherID''': The ID of new [[weather]]. Valid values are 0 to 255 inclusive.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the weather was set succesfully, ''false'' if an invalid ''weatherID'' was specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will change the weather to foggy.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setWeather ( 9 )&lt;br /&gt;
outputChatBox ( &amp;quot;Weather changed to foggy!&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;section class=&amp;quot;server&amp;quot; name=&amp;quot;Server&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
This example allows you to change weather with a command. (Anything above 255 resets, so 256 will be 0 and so on)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeWeather(player, command, weatherID)&lt;br /&gt;
	if (not weatherID or not tonumber(weatherID)) then --Check if weatherID is a number&lt;br /&gt;
		outputChatBox(&amp;quot;You must enter a valid weather ID number&amp;quot;, player, 255, 0, 0)&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	setWeather(weatherID) --Set the weather and let the player know he did it&lt;br /&gt;
	outputChatBox(&amp;quot;Weather successfully changed to ID &amp;quot;..weatherID, player, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;weather&amp;quot;, changeWeather)&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;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setWeather]]&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetWeather&amp;diff=58496</id>
		<title>SetWeather</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetWeather&amp;diff=58496"/>
		<updated>2018-08-21T19:05:28Z</updated>

		<summary type="html">&lt;p&gt;Danzy: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Server client function}}&lt;br /&gt;
This function sets the current [[weather]] to the given valid value. To change the weather gradually, see [[setWeatherBlended]].&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 setWeather ( int weatherID )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required Arguments===&lt;br /&gt;
*'''weatherID''': The ID of new [[weather]]. Valid values are 0 to 255 inclusive.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns ''true'' if the weather was set succesfully, ''false'' if an invalid ''weatherID'' was specified.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
This example will change the weather to foggy.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
setWeather ( 9 )&lt;br /&gt;
outputChatBox ( &amp;quot;Weather changed to foggy!&amp;quot; )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This example allows you to change weather with a command. (Anything above 255 resets, so 256 will be 0 and so on)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function changeWeather(player, command, weatherID)&lt;br /&gt;
	if (not weatherID or not tonumber(weatherID)) then --Check if weatherID is a number&lt;br /&gt;
		outputChatBox(&amp;quot;You must enter a valid weather ID number&amp;quot;, player, 255, 0, 0)&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	setWeather(weatherID) --Set the weather and let the player know he did it&lt;br /&gt;
	outputChatBox(&amp;quot;Weather successfully changed to ID &amp;quot;..weatherID, player, 0, 255, 0)&lt;br /&gt;
end&lt;br /&gt;
addCommandHandler(&amp;quot;weather&amp;quot;, changeWeather)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{World functions}}&lt;br /&gt;
&lt;br /&gt;
[[ru:setWeather]]&lt;/div&gt;</summary>
		<author><name>Danzy</name></author>
	</entry>
</feed>