ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. isPedDoingTask

Function

isPedDoingTask

ServerPedsTrilogy Hub only

Checks whether any of a ped's task layers holds a task with the given name (stored by setPedTask or by functions such as setPedEnterVehicle, which store enterVehicle).

Syntax

bool isPedDoingTask(ped ped, string taskName)

Arguments

pedped
A player or an NPC.
taskNamestring
Task name, e.g. "enterVehicle".

Returns

true when the ped has such a task.

Example

if isPedDoingTask(guard, "patrol") then return end

See also