Arma 3 Scripting

Function in Event Handlers

BIS_fnc_addStackedEventHandler

Also available as Markdown and JSON, or read the original wiki page.

Warning

This function is deprecated.

Description

Caution

This information is obsolete. Arma 3: Mission Event Handlers should be used instead.

Stacks an event handler. All event handlers accept user arguments, which are passed to the EH code in _this variable. If the EH has own params returned in _this variable as well, user arguments are appended to the end of _this array. Note that if you try to add an empty EH, i.e. with empty code, it will simply be ignored.

+ Supported Event Handlers Scripted Event Handler Mission EH Equivalent Description
"onEachFrame" EachFrame N/A
"onPlayerConnected" PlayerConnected Special variables _id, _uid, _name, _jip, _owner are provided and are available in _this array as well.
sqf
params ["_id", "_uid", "_name", "_jip", "_owner"];
"onPlayerDisconnected" PlayerDisconnected
"onMapSingleClick" MapSingleClick Special variables _units, _pos, _alt, _shift are provided and are available in _this array as well.
sqf
params ["_units", "_pos", "_alt", "_shift"];
"onPreloadStarted" PreloadStarted N/A
"onPreloadFinished" PreloadFinished N/A

Syntax

[id, event, code, arguments] call BIS_fnc_addStackedEventHandler

Parameters:

Returns: String - custom id on success or "" on failure

Examples

Example 1

["someId", "onEachFrame", { hintSilent str time }] call BIS_fnc_addStackedEventHandler;

Example 2

["someId", "onEachFrame", {hintSilent str position (_this select 0)}, [player]] call BIS_fnc_addStackedEventHandler;

Example 3

private _eventName = "OnEachFrame";
missionNamespace getVariable [format ["BIS_stackedEventHandlers_%1", _eventName], []]; // gets an array with all existing ids

Multiplayer

This command has the same locality as addMissionEventHandler.

See also

addMissionEventHandler · BIS_fnc_removeStackedEventHandler

Community notes