getPedAnalogControlState
Client-side
Server-side
Shared
Manual Review Required
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
float getPedAnalogControlState ( ped thePed, string controlName, bool rawValue )Required Arguments
- thePed: The ped you wish to retrieve the control state of.
- controlName: The control. See control names for a list of possible controls.
- rawValue: A bool indicating if it should return the raw player input value (will always return script value for non-player peds).
Returns
- float: value
Returns a float between 0 (full release) and 1 (full push) indicating the amount the control is pushed.
Code Examples
shared
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 endend)See Also
Ped Functions
- addPedClothes
- canPedBeKnockedOffBike
- createPed
- getPedAmmoInClip
- getPedAnalogControlState
- getPedAnimation
- getPedArmor
- getPedBonePosition
- getPedCameraRotation
- getPedClothes
- getPedContactElement
- getPedControlState
- getPedFightingStyle
- getPedGravity
- getPedMoveState
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedOxygenLevel
- getPedSimplestTask
- getPedStat
- getPedTarget
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedTotalAmmo
- getPedVoice
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponMuzzlePosition
- getPedWeaponSlot
- getValidPedModels
- givePedWeapon
- isPedBleeding
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDoingTask
- isPedDucked
- IsPedFootBloodEnabled
- isPedHeadless
- isPedInVehicle
- isPedOnGround
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- isPedWearingJetpack
- killPed
- playPedVoiceLine
- reloadPedWeapon
- removePedClothes
- removePedFromVehicle
- resetPedVoice
- setPedAimTarget
- setPedAnalogControlState
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedChoking
- setPedControlState
- setPedDoingGangDriveby
- setPedEnterVehicle
- setPedExitVehicle
- setPedFightingStyle
- setPedFootBloodEnabled
- setPedGravity
- setPedHeadless
- setPedLookAt
- setPedOxygenLevel
- setPedStat
- setPedTargetingMarkerEnabled
- setPedVoice
- setPedWalkingStyle
- setPedWeaponSlot
- setPedWearingJetpack
- warpPedIntoVehicle