IsPedDoingTask
From Multi Theft Auto: Wiki
This function checks if the specified ped is carrying out a certain task.
Syntax
bool isPedDoingTask ( ped thePed, string taskName )
Required Arguments
- thePed: The ped you want to check.
- taskName: A string containing the name of the task you're checking for.
Returns
Returns true if the player is currently doing the task, false otherwise.
Example
This example checks if the player who entered the 'doingdriveby' command is doing a drive-by (clientside).
function amIDoingADriveby () if ( isPedDoingTask ( getLocalPlayer(), "TASK_SIMPLE_GANG_DRIVEBY" ) ) then outputChatBox ( getPlayerName ( getLocalPlayer() ) .. " is doing a driveby!" ) else outputChatBox ( getPlayerName ( getLocalPlayer() ) .. " is not doing a driveby" ) end end addCommandHandler ( "doingdriveby", amIDoingADriveby )
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