KillPedTask: Difference between revisions
Jump to navigation
Jump to search
(killPedTask adding latest functions) |
|||
(One intermediate revision by the same user not shown) | |||
Line 25: | Line 25: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function playerPressedKey(button, press) | function playerPressedKey(button, press) | ||
local moveState = getPedMoveState( localPlayer ) | |||
if(moveState=="jump") then | |||
killPedTask(localPlayer, "primary", 3, true) | |||
end | |||
end | end | ||
addEventHandler("onClientKey", root, playerPressedKey) | addEventHandler("onClientKey", root, playerPressedKey) | ||
Line 36: | Line 35: | ||
==See Also== | ==See Also== | ||
{{Ped functions}} | {{Ped functions|client}} |
Latest revision as of 14:01, 22 December 2024
Syntax
bool killPedTask ( ped thePed, string taskType, int taskNumber, [ bool gracefully = true] )
Required arguments
- thePed: The ped element.
- taskType: The task type given primary or secondary, for more info see Tasks.
- taskNumber the task slot number for reference see Tasks.
Optional arguments
- gracefully If set to true the animation will be cut in a smooth transition, false otherwise.
Returns
If successful returns true, false otherwise.
Example
This example let you interrupt and cancel the jump animation action and clear the slot
function playerPressedKey(button, press) local moveState = getPedMoveState( localPlayer ) if(moveState=="jump") then killPedTask(localPlayer, "primary", 3, true) end end addEventHandler("onClientKey", root, playerPressedKey)
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