setPedAnalogControlState | Multi Theft Auto: Wiki Skip to content

setPedAnalogControlState

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.


Sets an analog state of a specified ped's control, as if they pressed or released it.

Syntax

setPedAnalogControlState ( )

Code Examples

client

This example uses setPedAnalogControlState to very slowly accelerate a ped-controlled NRG-500.

function createAnalogControlTest( )
local playerPosition = Vector3( getElementPosition( localPlayer ) )
local theVehicle = createVehicle( 522, playerPosition )
local thePed = createPed( 0, playerPosition )
warpPedIntoVehicle( thePed, theVehicle )
setPedAnalogControlState( thePed, "accelerate", 0.05 )
setPedAnalogControlState( thePed, "vehicle_left", 1 )
end
addCommandHandler( "analogcontroltest", createAnalogControlTest )

See Also