---
name: "BIS_fnc_onEnd"
type: function
status: ok
groups: ["Event Handlers"]
arma3_since: "0.50"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/BIS_fnc_onEnd
revid: 329730
updated: 2022-08-03T13:27:33Z
---

# BIS_fnc_onEnd

*Function · Event Handlers · Arma 3 v0.50 · introduced in Take On Helicopters v1.00*

## Description

Register code to be executed after mission end.

> [!NOTE]
> **Arma 3:** Replaced by ["Ended" mission event handler](../topics/Mission_Event_Handlers.md#ended).
>
> This function now exists only because of backward compatibility.

## Syntax

```sqf
argument call BIS_fnc_onEnd
```

**Parameters:**

- `argument`: [Code](../topics/Code.md), [Array](../topics/Array.md) or [Number](../topics/Number.md):
  - [Code](../topics/Code.md) - code to be executed
  - [Array](../topics/Array.md) - code with arguments in format [code, arguments]
  - [Number](../topics/Number.md) - remove code at given index

**Returns:** [Number](../topics/Number.md) - index of onEnd code

## Examples

### Example 1

```sqf
private _onEndIndex = { player addRating 10000; } call BIS_fnc_onEnd;
```

### Example 2

```sqf
private _onEndIndex = [{ { _x addRating 10000; } forEach _this; }, units group player] call BIS_fnc_onEnd;
```

## See also

[Event Scripts](../topics/Event_Scripts.md) · [Arma 3: Mission Event Handlers](../topics/Mission_Event_Handlers.md)

<sub>Source: [BI Community Wiki — BIS fnc onEnd](https://community.bistudio.com/wiki/BIS_fnc_onEnd) (revision 329730).</sub>
