getPedAnalogControlState | Multi Theft Auto: Wiki Skip to content

getPedAnalogControlState

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 function retrieves the analog control state of a ped, as set by setPedAnalogControlState.

Syntax

getPedAnalogControlState ( )

Code Examples

client

This exmaple creating a ped can drive with command/drive

local ped = createPed(0, 0,0,3)
local vehicle = createVehicle(554,0,0,3)
warpPedIntoVehicle(ped, vehicle)
addCommandHandler("drive",function()
isDriving = getPedAnalogControlState ( ped, "accelerate" ) -- get the analaog state of (accelerate)
if isDriving==1 then -- checks if equals 1 that means is driving
outputChatBox("Ped is driving stoping..")
setPedAnalogControlState( ped, "accelerate", 0 ) -- set the analaog (accelerate) to 0
else
outputChatBox("Starting drive")
setPedAnalogControlState( ped, "accelerate", 1 ) -- set the analaog (accelerate) to 1
end
end)

See Also