SetPedControlState: Difference between revisions
Jump to navigation
Jump to search
Einheit-101 (talk | contribs) m (Changed the fact that it now works with the local player just fine after r11427) |
m (Added a note for some users, this function wont work using enter_exit or enter_passanger on peds) |
||
Line 2: | Line 2: | ||
{{Client function}} | {{Client function}} | ||
This function makes a [[ped]] press or release a certain control. It doesn't work with the local player, so use [[setControlState]] instead. | This function makes a [[ped]] press or release a certain control. It doesn't work with the local player, so use [[setControlState]] instead. | ||
{{Note|You can't use enter_exit or enter_passanger with a ped}} | |||
{{New feature/item|3.0160|1.5|11427| | {{New feature/item|3.0160|1.5|11427| |
Revision as of 04:17, 16 December 2017
This function makes a ped press or release a certain control. It doesn't work with the local player, so use setControlState instead.
- Works with local player aswell.
Syntax
bool setPedControlState ( ped thePed, string control, bool state )
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 myPed = createPed(0, x + 1, y, z) if myPed then setPedControlState(myPed,"forwards", true) end end addCommandHandler("ped",newPed)
See Also
- canPedBeKnockedOffBike
- getPedAnalogControlState
- getPedAnimation
- getPedBonePosition
- getPedCameraRotation
- getPedControlState
- getPedMoveState
- getPedOxygenLevel
- getPedSimplestTask
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedVoice
- getPedWeaponMuzzlePosition
- givePedWeapon
- isPedBleeding
- isPedDoingTask
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- setAnalogControlState
- setPedAimTarget
- setPedAnalogControlState
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedControlState
- setPedEnterVehicle
- setPedExitVehicle
- IsPedFootBloodEnabled
- setPedFootBloodEnabled
- setPedLookAt
- setPedOxygenLevel
- setPedTargetingMarkerEnabled
- setPedVoice
- Shared
- addPedClothes
- getPedClothes
- removePedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getPedContactElement
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle