Warning: file_put_contents(/ff_51e8595449eb2feba56b278ef6058e0a7c6bd4c14062f7f5.php): failed to open stream: Permission denied in /home/ofpecsav/public_html/forum/Sources/Subs-ForumFirewall.php on line 1619
addMissionEventHandler - OFPEC Scripting Command Reference | OFPEC The Editing Center

addMissionEventHandler [type, function]

Operand types

[type, function]: Array

Type of returned value


Adds mission event handler. Every event will create an array named _this, which contains specific information about the particular event.

Available mission event handlers:

  • "Loaded" - Triggered when mission is succesfully loaded

  • "Ended" - Triggered when the mission is successfully ended. In variable _this is stored type of the end ("end1","end2", etc.).

  • "Draw3D" - It seems "Draw3D" mission EH is connected to your primary display. It will stop firing as soon as you Alt+Tab from the game and resume when you come back (unless Arma 3 client is launched with -window -nopause params). "Draw3D" does not fire at all on a dedicated server.

function: String or Code

Returned value (Number) is the eventhandler ID

Used In



_id = addMissionEventHandler ["Ended",{_this exec "missionEnded.sqs"}];