isPedDoingTask | Multi Theft Auto: Wiki Skip to content

isPedDoingTask

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function checks if the specified ped is carrying out a certain task.

Syntax

isPedDoingTask ( )

Code Examples

client

This example checks if the player who entered the 'doingdriveby' command is doing a drive-by (clientside).

function checkDriveBy()
local playerName = getPlayerName(localPlayer)
local doingDriveBy = isPedDoingTask(localPlayer, "TASK_SIMPLE_GANG_DRIVEBY")
local driveByStatus = doingDriveBy and "is doing a driveby!" or "is not doing a driveby."
outputChatBox(playerName.." "..driveByStatus)
end
addCommandHandler("doingdriveby", checkDriveBy)

See Also