getAnalogControlState | Multi Theft Auto: Wiki Skip to content

getAnalogControlState

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This retrieves the analog control state of a control. This is useful for detecting sensitive controls, such as those used on a joypad.

Syntax

getAnalogControlState ( )

Code Examples

client

This creates an/forwardscommand, which toggles yourforwardscontrol state between 0 and 1.

addCommandHandler( "forwards",
function( )
if ( getAnalogControlState( "forwards" ) == 0 ) then
setAnalogControlState( "forwards", 1 )
else
setAnalogControlState( "forwards", 0 )
end
end
)