IsPedDoingTask: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Client function}} This function checks if the specified ped is carrying out a certain task. ==Syntax== <syntaxhighlight lang="lua">bool isPlayerDoingTask ( ped thePe...) |
m (→Syntax) |
||
Line 4: | Line 4: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool | <syntaxhighlight lang="lua">bool isPedDoingTask ( ped thePed, string taskName )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== |
Revision as of 15:16, 26 June 2008
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
- 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