SetPedControlState
From Multi Theft Auto: Wiki
This function makes a ped or player press or release a certain control.
Note: You can't use enter_exit or enter_passenger on a ped. |
Syntax
bool setPedControlState ( ped thePed, string control, bool state )
OOP Syntax Help! I don't understand this!
- Method: Ped:setControlState(...)
Required Arguments
- thePed: the ped you want to press or release a control.
- control: the name of the control of which to change the state. See control names for a list of valid names.
- state: the new control state. true means pressed, false is released.
Returns
Returns true if successful, false if otherwise.
Example
Click to collapse [-]
Clientfunction newPed() local x, y, z = getElementPosition(localPlayer) local ped = createPed(0, x + 1, y, z) if ped then setPedControlState(ped, "forwards", true) end end addCommandHandler("ped", newPed)
Changelog
Version | Description |
---|
1.5.5-3.11427 | Works with the local player as well. Deprecated setControlState and getControlState. |
See Also
- getPedAmmoInClip
- getPedAnalogControlState
- getPedAnimation
- getPedArmor
- getPedBonePosition
- getPedCameraRotation
- getPedClothes
- getPedContactElement
- getPedControlState
- getPedFightingStyle
- getPedMoveState
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedOxygenLevel
- getPedSimplestTask
- getPedStat
- getPedTarget
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedTotalAmmo
- getPedVoice
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponMuzzlePosition
- getPedWeaponSlot
- getValidPedModels
- givePedWeapon
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDoingTask
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedClothes
- removePedFromVehicle
- setAnalogControlState
- setPedAimTarget
- setPedAnalogControlState
- setPedAnimation
- setPedAnimationProgress
FROM VERSION 1.5.7 r19626 ONWARDS
FROM VERSION 1.5.7 r19626 ONWARDS
- setPedFootBloodEnabled
- setPedHeadless
- setPedLookAt
- setPedOnFire
- setPedOxygenLevel
- setPedStat
- setPedTargetingMarkerEnabled
- setPedVoice
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle