setAnalogControlState | Multi Theft Auto: Wiki Skip to content

setAnalogControlState

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 sets the analog control state of a control for the local player. To change the analog controls for a ped, please use setPedAnalogControlState.

Syntax

setAnalogControlState ( )

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
)