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.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.params ["_units", "_pos", "_alt", "_shift"]; "onPreloadStarted" PreloadStarted N/A "onPreloadFinished" PreloadFinished N/A
- This command has the same locality as addMissionEventHandler.
- Event Handlers
- [id, event, code, arguments] call BIS_fnc_addStackedEventHandler
- id: String - custom id, a unique identifier. Adding same type of EH with the same id will overwrite existing
- event: String - event handler name, see description for supported EHs
- code: Code or String. The String is treated as function name
- arguments: Array of Anything - arguments to make available in code in _this array
- Return Value:
- String - custom id on success or "" on failure
- Example 1:
- Example 2:
- Example 3:
- Posted on Jun 25, 2014 - 12:08 (UTC)
Stacking all the code into one PFH will be less demanding than separated calling within multiple PFH, e.g: