HU/getPedControlState: Difference between revisions
Jump to navigation
Jump to search
(Created page with "__NOTOC__ {{Client function hu}} Checks whether a ped has a certain control pressed. ==Szintaxis== <syntaxhighlight lang="lua"> bool getPedControlState ( ped thePed, string c...") |
|||
Line 47: | Line 47: | ||
==Lásd még== | ==Lásd még== | ||
{{Client ped functions}} | {{Client ped functions hu}} | ||
[[en:getPedControlState]] | [[en:getPedControlState]] |
Revision as of 17:28, 8 October 2018
Checks whether a ped has a certain control pressed.
Szintaxis
bool getPedControlState ( ped thePed, string control )
Kötelező paraméterek
- thePed: the ped you want to check.
- control: the control to get the status of. See control names for a list of valid names.
Visszatérési érték
Returns true if the ped is pressing the specified control, false if not or an invalid argument was passed.
Példa
Click to collapse [-]
Clientlocal controlTable = {"forwards", "backwards", "left", "right", "jump", "crouch"} function invisibleOnSpawn() setElementAlpha (localPlayer, 0) checkControlState = setTimer(controlState, 50, 0) end addEventHandler ("onClientPlayerSpawn", localPlayer, invisibleOnSpawn) function controlState() for i,control in ipairs(controlTable) do local state = getPedControlState(localPlayer, control) if (state) then setElementAlpha (localPlayer, 255) if (isTimer(checkControlState)) then killTimer(checkControlState) checkControlState = nil end end end end
Changelog
Version | Description |
---|
1.5.5-3.11427 | Works with the local player as well. Deprecated setControlState and getControlState. |
Lásd még
- HU/addPedClothes
- HU/canPedBeKnockedOffBike
- HU/createPed
- HU/getPedAmmoInClip
- HU/getPedAnalogControlState
- HU/getPedAnimation
- HU/getPedArmor
- HU/getPedBonePosition
- HU/getPedCameraRotation
- HU/getPedClothes
- HU/getPedContactElement
- HU/getPedControlState
- HU/getPedMoveState
- HU/getPedOccupiedVehicle
- HU/getPedOccupiedVehicleSeat
- HU/getPedOxygenLevel
- HU/getPedSimplestTask
- HU/getPedStat
- HU/getPedTarget
- HU/getPedTargetCollision
- HU/getPedTargetEnd
- HU/getPedTargetStart
- HU/getPedTask
- HU/getPedTotalAmmo
- HU/getPedVoice
- HU/getPedWalkingStyle
- HU/getPedWeapon
- HU/getPedWeaponMuzzlePosition
- HU/getPedWeaponSlot
- HU/getValidPedModels
- HU/givePedWeapon
- HU/isPedChoking
- HU/isPedDead
- HU/isPedDoingGangDriveby
- HU/isPedDoingTask
- HU/isPedDucked
- HU/isPedHeadless
- HU/isPedInVehicle
- HU/isPedOnFire
- HU/isPedOnGround
- HU/isPedWearingJetpack
- HU/killPed
- HU/removePedClothes
- HU/removePedFromVehicle
- HU/setAnalogControlState
- HU/setPedAimTarget
- HU/setPedAnalogControlState
- HU/setPedAnimation
- HU/setPedAnimationProgress
- HU/setPedCameraRotation
- HU/setPedCanBeKnockedOffBike
- HU/setPedControlState
- HU/setPedDoingGangDriveby
- HU/setPedFootBloodEnabled
- HU/setPedHeadless
- HU/setPedLookAt
- HU/setPedOnFire
- HU/setPedOxygenLevel
- HU/setPedStat
- HU/setPedTargetingMarkerEnabled
- HU/setPedVoice
- HU/setPedWalkingStyle
- HU/setPedWeaponSlot
- HU/warpPedIntoVehicle