getPedTask | Multi Theft Auto: Wiki Skip to content

getPedTask

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 is used to get any simple or complex task of a certain type for a ped.

Syntax

getPedTask ( )

Code Examples

client

This example draws the active primary and secondary tasks (including task hierarchy in 1.1) as your local player moves around the world.

local function renderPlayerTasks()
local textX, textY = 100, 200
for taskType = 0, 4 do
local a, b, c, d = getPedTask(localPlayer, "primary", taskType)
dxDrawText("Primary task #"..taskType.." is "..tostring(a).." -> "..tostring(b).." -> "..tostring(c).." -> "..tostring(d).." -> ", textX, textY)
textY = (textY + 15)
end
textY = (textY + 15)
for taskType = 0, 5 do
local a, b, c, d = getPedTask(localPlayer, "secondary", taskType)
dxDrawText("Secondary task #"..taskType.." is "..tostring(a).." -> "..tostring(b).." -> "..tostring(c).." -> "..tostring(d).." -> ", textX, textY)
textY = (textY + 15)
end
end
addEventHandler("onClientRender", root, renderPlayerTasks)

See Also