M MY Multiplayer: Wiki
Side
Kind

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

NameTypeDescription
pedpedThe ped or player.
taskNamestringThe 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

See also