isPedDoingTask
Client
Tells whether a ped is running a task, in any slot and at any subtask level.
bool isPedDoingTask(ped ped, string taskName)
Parameters
| Name | Type | Description |
|---|---|---|
| ped | ped | The ped or player. |
| taskName | string | The task's name, such as TASK_SIMPLE_SWIM. Case does not matter. |
Returns
true if the task is under way, false if not or if the ped does not exist in the game.
Example
if isPedDoingTask(localPlayer, "TASK_SIMPLE_SWIM") then
print("Swimming")
end