Tasks
Setup task event callbacks
--- Use onStart and onFinish callbacks for task functions
---@param ped number
---@param taskHash hash
---@param onStart function
---@param onFinish
function SRB.CallTaskEvents(ped, taskHash, onStart, onFinish)
Go to coords any means
--- TaskGoToCoordAnyMeans with onStart and onFinish callbacks
---@param ped number
---@param x number
---@param y number
---@param z number
---@param speed number
---@param entity entity
---@param walkingStyle number
---@param onStart function
---@param onFinish function
function SRB.TaskGoToCoordAnyMeans(ped, x, y, z, speed, entity, walkingStyle, onStart, onFinish)
Go to entity
--- TaskGoToEntity with onStart and onFinish callbacks
---@param ped number
---@param target entity
---@param duration number
---@param distance number
---@param speed number
---@param onStart function
---@param onFinish function
function SRB.TaskGoToEntity(ped, target, duration, distance, speed, onStart, onFinish)
Use nearest scenario to coord
--- TaskUseNearestScenarioToCoord with onStart and onFinish callbacks
---@param ped number
---@param x number
---@param y number
---@param z number
---@param distance number
---@param duration number
---@param onStart function
---@param onFinish function
function SRB.TaskUseNearestScenarioToCoord(ped, x, y, z, distance, duration, onStart, onFinish)
Start scenario in place
--- TaskStartScenarioInPlace with onStart and onFinish callbacks
---@param ped number
---@param scenario hash
---@param duration number
---@param onStart function
---@param onFinish function
function SRB.TaskStartScenarioInPlace(ped, scenario, duration, onStart, onFinish)
Play anim
--- TaskPlayAnim with onStart and onFinish callbacks
---@param ped number
---@param dict string
---@param anim string
---@param speed number
---@param duration number
---@param onStart function
---@param onFinish function
function SRB.TaskPlayAnim(ped, dict, anim, speed, duration, onStart, onFinish)
Last updated