<?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=Tekken</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=Tekken"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/wiki/Special:Contributions/Tekken"/>
	<updated>2026-04-30T04:54:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=SetAnalogControlState&amp;diff=49429</id>
		<title>SetAnalogControlState</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=SetAnalogControlState&amp;diff=49429"/>
		<updated>2016-10-06T04:58:30Z</updated>

		<summary type="html">&lt;p&gt;Tekken: /* Example */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Client function}}&lt;br /&gt;
This sets the analog control state of a control for the local player.&lt;br /&gt;
&lt;br /&gt;
To change the analog controls for a ped, please use [[setPedAnalogControlState]].&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; bool setAnalogControlState ( string controlName [, float state] ) &amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
===Required Arguement===&lt;br /&gt;
* '''controlName''': the control name you wish to set the analog state of. Here's a list:&lt;br /&gt;
**'''left'''&lt;br /&gt;
**'''right'''&lt;br /&gt;
**'''forwards'''&lt;br /&gt;
**'''backwards'''&lt;br /&gt;
**'''vehicle_left'''&lt;br /&gt;
**'''vehicle_right'''&lt;br /&gt;
**'''steer_forward'''&lt;br /&gt;
**'''steer_back'''&lt;br /&gt;
**'''accelerate'''&lt;br /&gt;
**'''brake_reverse'''&lt;br /&gt;
**'''special_control_left'''&lt;br /&gt;
**'''special_control_right'''&lt;br /&gt;
**'''special_control_up'''&lt;br /&gt;
**'''special_control_down'''&lt;br /&gt;
&lt;br /&gt;
===Optional Arguments===&lt;br /&gt;
*'''state:''' A float between 0 and 1 indicating the amount the control is pressed. If no value is provided, the analog control is removed.&lt;br /&gt;
&lt;br /&gt;
===Returns===&lt;br /&gt;
Returns true, else false if invalid argument.&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
/analog command starts to go forward control state if you are not, if you are going forward by control state then you will stop.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addCommandHandler(&amp;quot;analog&amp;quot;, function()&lt;br /&gt;
    if (getAnalogControlState(&amp;quot;forwards&amp;quot;) == 0) then&lt;br /&gt;
        setAnalogControlState(&amp;quot;forwards&amp;quot;, 1);&lt;br /&gt;
    else&lt;br /&gt;
        setAnalogControlState(&amp;quot;forwards&amp;quot;, 0);&lt;br /&gt;
    end&lt;br /&gt;
end);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This example written by '''Samurai'''&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Client input functions}}&lt;/div&gt;</summary>
		<author><name>Tekken</name></author>
	</entry>
</feed>