---
name: "BIS_fnc_taskHandler"
type: function
status: ok
groups: ["Tasks"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_taskHandler
revid: 353667
updated: 2024-03-20T18:50:01Z
---

# BIS_fnc_taskHandler

*Function · Tasks · Arma 3 v0.50 · introduced in Arma 2 v1.00*

## Description

automatically sets tasks as current

## Syntax

*syntax inferred from the function header*

```sqf
[param0, param1] call BIS_fnc_taskHandler
```

**Parameters:**

- `param0` — 0: a unit whose tasks will be handled (Array)
- `param1` — 1: links to tasks created via MP Framwork with
  priorities (loewr number means higher
  priority)

**Returns:** none

## Examples

### Example 1

```sqf
[
                    BIS_cooper,
                   [
                       ["objShaftoe",           1],
                       ["objGorka",            3],
                       ["objNikolayev",        5],
                       ["objLagushina",           5],
                       ["objSmugglers",           5],
                       ["objFindBase",            4],
                       ["objSentries",           3],
                       ["objLeader",            3],
                       ["objDestroyBase",        3],
                       ["objEscortLagushina",    1],
                       ["objRescueCrew",       2],
                       ["objSafehouse",        3],
                       ["objMaksim",            6],
                       ["objEvidence",            7]
                   ]
               ] call BIS_fnc_taskHandler
```

### Example 2

```sqf
TODO:            * generalize so it can be used in WF
                 add support for standard tasks
                 randomize the selection of tasks with the same priority
```

## Function header

The comment at the top of the function's file in the game; this page's description, params, syntax, returns, examples come from it.

```sqf
/*
version:         1.0
name:            Task handler
description:    automatically sets tasks as current
parameters:        _this select 0: a unit whose tasks will be handled (Array)
                _this select 1: links to tasks created via MP Framwork with
                                priorities (loewr number means higher
                                priority)
return value:    none
 example:         [
                    BIS_cooper,
                   [
                       ["objShaftoe",           1],
                       ["objGorka",            3],
                       ["objNikolayev",        5],
                       ["objLagushina",           5],
                       ["objSmugglers",           5],
                       ["objFindBase",            4],
                       ["objSentries",           3],
                       ["objLeader",            3],
                       ["objDestroyBase",        3],
                       ["objEscortLagushina",    1],
                       ["objRescueCrew",       2],
                       ["objSafehouse",        3],
                       ["objMaksim",            6],
                       ["objEvidence",            7]
                   ]
               ] call BIS_fnc_taskHandler

TODO:            * generalize so it can be used in WF
                 add support for standard tasks
                 randomize the selection of tasks with the same priority
*/
```

<sub>Source: [BI Community Wiki — BIS fnc taskHandler](https://community.bistudio.com/wiki/BIS_fnc_taskHandler) (revision 353667).</sub>
