{"name":"Arma 3: Event Handlers","title":"Arma 3: Event Handlers","type":"topic","url":"https://community.bistudio.com/wiki/Arma_3:_Event_Handlers","revid":378964,"updated":"2026-09-07T08:29:27Z","aliases":["ArmA 3: Event Handlers"],"markdown":"An Event Handler (abbreviated to EH) allows you to automatically monitor and then execute custom code upon particular events being triggered.\n\nSee also Event Scripts for special event triggered scripts.\n\n### Basic Event Handlers\n\nThe object-based Event Handler is always executed on the computer where it was added.\n\nCommands:\n- addEventHandler\n- removeEventHandler\n- removeAllEventHandlers\n\n#### AmmoExplodedNear (Arma 3 v2.22)\n\nTriggers when ammo explodes in some damage range of the object. This EH triggers where the ammo is 'real', similar to HitPart.\n\n```sqf\nthis addEventHandler [\"AmmoExplodedNear\", {\n    params [\"_object\", \"_shot\", \"_position\", \"_velocity\", \"_ammo\", \"_explosive\", \"_indirectHit\", \"_invArmor\", \"_damage\"];\n}];\n```\n\n- object: Object - object the event handler is assigned to\n- shot: Object - shot that has exploded\n- position: Array - world position of the shot\n- velocity: Array - world velocity of the shot\n- ammmo: String - config ammo class name\n- explosive: Number - config value for 'explosive'\n- indirectHit: Number - config value for 'indirectHit'\n- invArmor: Number - calculated inverse armor from config value\n- damage: Number - a rough estimate of the potential damage to the center of the object based on config values and the distance\n\n#### AnimChanged\n\nGlobal Argument\n\nTriggered every time a new animation is started. This EH is only triggered for the 1st animation state in a sequence.\n\n```sqf\nthis addEventHandler [\"AnimChanged\", {\n    params [\"_unit\", \"_anim\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- anim: String - name of the anim that is started\n\n#### AnimDone\n\nGlobal Argument\n\nTriggered every time an animation is finished. Triggered for all animation states in a sequence.\n\n```sqf\nthis addEventHandler [\"AnimDone\", {\n    params [\"_unit\", \"_anim\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- anim: String - name of the anim that has been finished\n\n#### AnimStateChanged\n\nGlobal Argument\n\nTriggered every time an animation state changes. Triggered for all animation states in a sequence.\n\n```sqf\nthis addEventHandler [\"AnimStateChanged\", {\n    params [\"_unit\", \"_anim\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- anim: String - name of the anim that has been started\n\n#### Assembled (Arma 3 v2.18)\n\nLocal Argument\n\nTriggers when weapon that is moved out of the world is assembled again. EH should be attached to the entity.\n\n```sqf\nthis addEventHandler [\"Assembled\", {\n    params [\"_entity\", \"_unit\", \"_primaryBag\", \"_secondaryBag\"];\n}];\n```\n\n- entity: Object - weapon this event is assigned to\n- unit: Object - person who assembled the weapon\n- primaryBag: Object - first backpack object which was entity disassembled into (just before it is deleted)\n- secondaryBag: Object - second backpack object which was entity disassembled into (just before it is deleted)\n\n#### Attached (Arma 3 v2.18)\n\nTriggered after an object has been attached to another object (see attachTo).\n\n```sqf\nthis addEventHandler [\"Attached\", {\n    params [\"_attachedObj\", \"_parentObj\", \"_isReattach\", \"_offset\", \"_memoryPointIndex\", \"_followBoneRotation\"];\n}];\n```\n\n- attachedObj: Object\n- parentObj: Object\n- isReattach: Boolean - true if `attachedObj` was already attached to `parentObj`, e.g. if only the offset was changed\n- offset: Array format PositionRelative\n- memoryPointIndex: Number\n- followBoneRotation: Boolean\n\n#### CargoLoaded (Arma 3 v2.06)\n\nGlobal Argument\n\nTriggered when a vehicle is loaded into another vehicle (ViV).\n\nIt can be added to either the transport vehicle, or the cargo vehicle, and will fire for both cases.\n\n```sqf\nthis addEventHandler [\"CargoLoaded\", {\n    params [\"_parentVehicle\", \"_cargoVehicle\"];\n}];\n```\n\n- parentVehicle: Object - the transport (parent) vehicle\n- cargoVehicle: Object - the cargo (child) vehicle\n\n#### CargoUnloaded (Arma 3 v2.06)\n\nGlobal Argument\n\nTriggered when a vehicle is unloaded from another vehicle (ViV).\n\nIt can be added to either the transport vehicle, or the cargo vehicle, and will fire for both cases.\n\n```sqf\nthis addEventHandler [\"CargoUnloaded\", {\n    params [\"_parentVehicle\", \"_cargoVehicle\"];\n}];\n```\n\n- parentVehicle: Object - the transport (parent) vehicle\n- cargoVehicle: Object - the cargo (child) vehicle\n\n#### ContainerClosed (Arma 3 v1.32)\n\nGlobal Argument\n\nTriggers when player finished accessing cargo container.\nThis event handler is similar to InventoryClosed EH, but needs to be assigned to the container rather than the player.\n\n**Note:** will trigger only for the unit opening container.\n\n```sqf\nthis addEventHandler [\"ContainerClosed\", {\n    params [\"_container\", \"_unit\"];\n}];\n```\n\n- container: Object - cargo container.\n- unit: Object - unit who accessed the container\n\n#### ContainerOpened (Arma 3 v1.32)\n\nGlobal Argument\n\nTriggers when cargo container is accessed by player.\nThis event handler is similar to InventoryOpened EH, but needs to be assigned to the container rather than the player and cannot be overridden.\n\n**Note:** will trigger only for the unit opening container.\n\n```sqf\nthis addEventHandler [\"ContainerOpened\", {\n    params [\"_container\", \"_unit\"];\n}];\n```\n\n- container: Object - cargo container\n- unit: Object - unit who accessed the container\n\n#### ControlsShifted (Arma 3 v1.00)\n\nGlobal ArgumentLocal Effect\n\nTriggers when control of a vehicle is shifted (pilot->co-pilot, co-pilot->pilot), usually when user performs an action such as TakeVehicleControl, SuspendVehicleControl, UnlockVehicleControl, LockVehicleControl, or when enableCopilot command is used. This event handler will always fire on the PC where action is triggered as well as where the vehicle is local at the time. When control of the vehicle is shifted, the locality of the vehicle changes to the locality of the new controller. For example, if helicopter is local to the server and co-pilot takes controls, the helicopter changes locality to co-pilot PC.\nThis means that if \"ControlsShifted\" EH was added on both server and client, \"Take Controls\" action will trigger EH on both, client and server PC, but subsequent co-pilot \"Release Controls\" action will trigger only on co-pilot's PC, because vehicle will be local to co-pilot at this point. There is also a slightly better mission version of ControlsShifted event handler.\n\n```sqf\nthis addEventHandler [\"ControlsShifted\", {\n    params [\"_vehicle\", \"_activeCoPilot\", \"_oldController\"];\n}];\n```\n\n- vehicle: Object - vehicle which controls were shifted\n- activeCoPilot: Object - co-pilot unit which controls vehicle after this event. objNull if co-pilot is not controlling the vehicle\n- oldController: Object - unit who controlled vehicle before this event\n\n#### Dammaged\n\nGlobal Argument\n\nTriggered when the unit is damaged. In ArmA works with all vehicles not only men like in OFP.\n\n**Notes:**\n- The typo is \"intentional\": it is Da**mm**aged with two \"m\".\n- If simultaneous damage occured (e.g. via grenade) EH might be triggered several times.\n- The Dammaged EH will not necessarily fire if only minor damage occurred (e.g. firing a bullet at a tank), even though the damage increased.\n\n```sqf\nthis addEventHandler [\"Dammaged\", {\n    params [\"_unit\", \"_hitSelection\", \"_damage\", \"_hitPartIndex\", \"_hitPoint\", \"_shooter\", \"_projectile\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- hitSelection: String - name of the selection where the unit was damaged\n- damage: Number - resulting level of damage\n- Arma 3 v1.68 hitPartIndex: Number - hit index of the hit selection\n- Arma 3 v1.68 hitPoint: String - hit point Cfg name\n- Arma 3 v1.70 shooter: Object - shooter reference (to get instigator use getShotParents on projectile)\n- Arma 3 v1.70 projectile: Object - the projectile that caused damage\n\n#### Deleted (Entity) (Arma 3 v1.68)\n\nGlobal Argument\n\nTriggered just before the assigned entity is deleted.\n\n```sqf\nthis addEventHandler [\"Deleted\", {\n    params [\"_entity\"];\n}];\n```\n\n- entity: Object - object the event handler is assigned to\n\n#### Detached (Arma 3 v2.18)\n\nTriggered after an object has been detached from its parent object (see detach). Does not fire if the parent object was deleted.\n\n```sqf\nthis addEventHandler [\"Detached\", {\n    params [\"_attachedObj\", \"_parentObj\"];\n}];\n```\n\n- attachedObj: Object\n- parentObj: Object\n\n#### Disassembled (Arma 3 v2.00)\n\nLocal Argument\n\nTriggers when entity such as weapon/backpack gets disassembled. EH should be attached to the entity.\n\n```sqf\nthis addEventHandler [\"Disassembled\", {\n    params [\"_entity\", \"_primaryBag\", \"_secondaryBag\", \"_unit\"];\n}];\n```\n\n- entity: Object - weapon this event is assigned to (just before is is moved out of the world)\n- primaryBag: Object - first backpack object which was entity disassembled into\n- secondaryBag: Object - second backpack object which was entity disassembled into\n- Arma 3 v2.18 unit: Object - person who disassembled the weapon\n\n#### Engine\n\nGlobal Argument\n\nTriggered when the engine of the unit is turned on/off.\n\n> [!NOTE]\n> Although the event is global, on clients (non-server) and applied to remote vehicles, it will fire only if the vehicle is closer than about 6 km from the camera.\n> Should the vehicle be far away, it will fire as soon as the camera and vehicle are close enough together, alongside the isEngineOn flag change.\n\n```sqf\nthis addEventHandler [\"Engine\", {\n    params [\"_vehicle\", \"_engineState\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- engineState: Boolean - true when the engine is turned on, false when turned off\n\n#### EpeContact (Arma 3 v1.00)\n\nGlobal Argument\n\nTriggered when object collision (PhysX) is in progress.\n\n```sqf\nthis addEventHandler [\"EpeContact\", {\n    params [\"_object1\", \"_object2\", \"_selection1\", \"_selection2\", \"_force\", \"_reactVect\", \"_worldPos\"];\n}];\n```\n\n- object1: Object - object with attached handler\n- object2: Object - object which is colliding with object1\n- selection1: String - selection of object1 which is colliding - not in use at this moment, empty string is always returned\n- selection2: String - selection of object2 which is colliding - not in use at this moment, empty string is always returned\n- force: Number - force of collision\n- Arma 3 v2.12 reactVect: Array - impact reaction force vector\n- Arma 3 v2.12 worldPos: PositionWorld - point of impact in world coordinates\n\n#### EpeContactEnd (Arma 3 v1.00)\n\nGlobal Argument\n\nTriggered when object collision (PhysX) ends.\n\n```sqf\nthis addEventHandler [\"EpeContactEnd\", {\n    params [\"_object1\", \"_object2\", \"_selection1\", \"_selection2\", \"_force\"];\n}];\n```\n\n- object1: Object - object with attached handler\n- object2: Object - object which is colliding with object1\n- selection1: String - selection of object1 which is colliding - not in use at this moment, empty string is always returned\n- selection2: String - selection of object2 which is colliding - not in use at this moment, empty string is always returned\n- force: Number - force of collision\n\n#### EpeContactStart (Arma 3 v1.00)\n\nGlobal Argument\n\nTriggered when object collision (PhysX) starts.\n\n```sqf\nthis addEventHandler [\"EpeContactStart\", {\n    params [\"_object1\", \"_object2\", \"_selection1\", \"_selection2\", \"_force\", \"_reactForce\", \"_worldPos\"];\n}];\n```\n\n- object1: Object - object with attached handler\n- object2: Object - object which is colliding with object1\n- select1: String - selection of object1 which is colliding - not in use at this moment, empty string is always returned\n- select2: String - selection of object2 which is colliding - not in use at this moment, empty string is always returned\n- force: Number - force of collision\n- Arma 3 v2.12 reactForce: Array - impact reaction force vector\n- Arma 3 v2.12 worldPos: PositionWorld - point of impact in world coordinates\n\n#### Explosion (Arma 3 v0.76)\n\nGlobal Argument\n\nTriggered when a vehicle or unit is damaged by a nearby explosion.\nIt can be assigned to a remote unit or vehicle but will only fire on the PC where EH is added and explosion is local, i.e. it really needs to be added on every PC and JIP and will fire only where the explosion is originated.\n\n```sqf\nthis addEventHandler [\"Explosion\", {\n    params [\"_vehicle\", \"_damage\", \"_explosionSource\"];\n}];\n```\n\n- vehicle: Object - object the event handler is assigned to\n- damage: Number - damage inflicted to the object\n- Arma 3 v2.10 explosionSource: Object - the exploding object (NOT the shooter) - may be objNull in some cases\n\n> [!NOTE]\n> This event will fire even for tiniest of explosion damage (which appears as 0 damage argument), while #HitPart (Entity) could ignore such damage and not fire.\n> Example of such event would be a tank firing AP round and hitting ground a meter away from the vehicle, it does not produce an explosion yet its indirectHit could still cause tiny amount of damage to weak hit points (car wheels, headlights, etc.).\n> In such case you might not get any #HitPart (Entity) event fires, get some #HandleDamage events if target is local, and get this Explosion event.\n\n#### Fired\n\nGlobal Argument\n\nTriggered when the unit fires a weapon.\n\nThis EH will not trigger if a unit fires out of a vehicle. For those cases an EH has to be attached to that particular vehicle.\nWhen \"Manual Fire\" is used, the *gunner* is objNull if gunner is not present or the *gunner* is not the one who fires.\nTo check if \"Manual Fire\" is on, use isManualFire. The actual shot instigator could be retrieved with getShotParents command.\n\n> [!WARNING]\n> **Special multiplayer behaviour:** When added to a remote unit or vehicle, this EH will only fire if said entity is within range of the camera.\n> That range is determined by the fired ammo's highest visibleFire and audibleFire config value.\n> In case of units, muzzle attachment coefficients are applied too.\n\n```sqf\nthis addEventHandler [\"Fired\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_mode\", \"_ammo\", \"_magazine\", \"_projectile\", \"_gunner\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- weapon: String - fired weapon\n- muzzle: String - muzzle that was used\n- mode: String - current mode of the fired weapon\n- ammo: String - ammo used\n- magazine: String - magazine name which was used\n- projectile: Object - object of the projectile that was shot out\n- Arma 3 v1.66 gunner: Object - gunner whose weapons are firing.\n\n#### FiredMan (Arma 3 v1.66)\n\nGlobal Argument\n\nTriggered when the unit fires a weapon. This EH must be attached to a soldier and unlike with \"Fired\" EH, it will fire regardless of whether the soldier is on foot or firing vehicle weapon.\nFor remoteControled unit use \"Fired\" EH instead.\n\n> [!WARNING]\n> **Special multiplayer behaviour:** When added to a remote unit or vehicle, this EH will only fire if said entity is within range of the camera.\n> That range is determined by the fired ammo's highest visibleFire and audibleFire config value.\n> In case of units, muzzle attachment coefficients are applied too.\n\n```sqf\nthis addEventHandler [\"FiredMan\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_mode\", \"_ammo\", \"_magazine\", \"_projectile\", \"_vehicle\"];\n}];\n```\n\n- unit: Object - unit the event handler is assigned to (the instigator)\n- weapon: String - fired weapon\n- muzzle: String - muzzle that was used\n- mode: String - current mode of the fired weapon\n- ammo: String - ammo used\n- magazine: String - magazine name which was used\n- projectile: Object - object of the projectile that was shot out\n- vehicle: Object - vehicle, if weapon is vehicle weapon, otherwise objNull\n\n#### FiredNear\n\nGlobal Argument\n\nTriggered when a weapon is fired somewhere *near* the unit or vehicle. It is also triggered if the unit itself is firing.\n\nWhen \"Manual Fire\" is used, the *gunner* is objNull if gunner is not present or the *gunner* is not the one who fires.\nTo check if \"Manual Fire\" is on, use isManualFire. The actual shot instigator can be retrieved with getShotParents command.\n\nArma 3 v1.30 Works with thrown weapons (using the \"Throw\" weapon) like grenades.\n\n```sqf\nthis addEventHandler [\"FiredNear\", {\n    params [\"_unit\", \"_firer\", \"_distance\", \"_weapon\", \"_muzzle\", \"_mode\", \"_ammo\", \"_gunner\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- firer: Object - object which fires a weapon near the unit\n- distance: Number - distance in meters between the *unit* and *firer* (max. distance ~69m)\n- weapon: String - fired weapon\n- muzzle: String - muzzle that was used\n- mode: String - current mode of the fired weapon\n- ammo: String - ammo used\n- Arma 3 v1.66 gunner: Object - gunner, whose weapons are fired\n\n#### Fuel\n\nGlobal Argument\n\nTriggered when the vehicle's fuel status changes between non-empty and empty or between empty and non-empty.\n\n```sqf\nthis addEventHandler [\"Fuel\", {\n    params [\"_vehicle\", \"_hasFuel\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- hasFuel: Boolean - false when has no fuel, true when has some fuel\n\n#### Gear\n\nGlobal Argument\n\nTriggered when the unit lowers/retracts the landing gear, whether it is a helicopter or a plane.\nAlso triggered for helicopters in landing mode, regardless if they have retractable gear or not.\n\n> [!NOTE]\n> Not to be confused with *InventoryOpened* and *InventoryClosed* events, *Gear* fires when the landing gear state on an aircraft has changed.\n\n```sqf\nthis addEventHandler [\"Gear\", {\n    params [\"_vehicle\", \"_gearState\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- gearState: Boolean - true when the gear is lowered, false when retracted\n\n#### GestureChanged (Arma 3 v2.06)\n\nGlobal Argument\n\nTriggered every time a new gesture is played.\n\n```sqf\nthis addEventHandler [\"GestureChanged\", {\n    params [\"_unit\", \"_gesture\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- gesture: String - name of the gesture that has started playing\n\n#### GestureDone (Arma 3 v2.06)\n\nGlobal Argument\n\nTriggered every time a gesture is finished.\n\n```sqf\nthis addEventHandler [\"GestureDone\", {\n    params [\"_unit\", \"_gesture\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- gesture: String - name of the gesture that has been finished\n\n#### GetIn\n\nGlobal Argument\n\nTriggers when a unit enters the vehicle to which this EH has been added. This EH is triggered by moveInXXXX commands and \"GetInXXXX\" actions, but not upon a seat change within the same vehicle.\n\nIn vehicles with multi-turret setup, entering any turret will show \"gunner\" for position.\n\n```sqf\nthis addEventHandler [\"GetIn\", {\n    params [\"_vehicle\", \"_role\", \"_unit\", \"_turret\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- role: String - can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n- unit: Object - unit that entered the vehicle\n- Arma 3 v1.36 turret: Array - turret path\n\n#### GetInMan (Arma 3 v1.58)\n\nGlobal Argument\n\nTriggers when a unit enters a vehicle. Similar to \"GetIn\" but must be assigned to a unit and not vehicle.\nPersistent on respawn if assigned where unit was local. This EH is triggered by moveInXXXX commands and \"GetInXXXX\" actions.\n\n```sqf\nthis addEventHandler [\"GetInMan\", {\n    params [\"_unit\", \"_role\", \"_vehicle\", \"_turret\"];\n}];\n```\n\n- unit: Object - unit the event handler is assigned to\n- role: String - can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n- vehicle: Object - vehicle the unit entered\n- turret: Array - turret path\n\n#### GetOut\n\nGlobal Argument\n\nTriggers when a unit gets out from the vehicle to which this EH has been added.\nThis EH is triggered by moveOut, \"GetOut\" & \"Eject\" actions, if an alive crew member disconnects or is deleted, but not upon a seat change within the same vehicle.\n\n```sqf\nthis addEventHandler [\"GetOut\", {\n    params [\"_vehicle\", \"_role\", \"_unit\", \"_turret\", \"_isEject\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- role: String - can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n- unit: Object - unit that left the vehicle\n- Arma 3 v1.36 turret: Array - turret path\n- Arma 3 v2.14 isEject: Boolean - true if unit used 'Eject' action\n\n#### GetOutMan (Arma 3 v1.58)\n\nGlobal Argument\n\nTriggers when a unit exits a vehicle. Similar to \"GetOut\" but must be assigned to a unit and not vehicle.\nPersistent on respawn if assigned where unit was local. This EH is triggered by moveOut and \"GetOut\" & \"Eject\" actions.\n\n```sqf\nthis addEventHandler [\"GetOutMan\", {\n    params [\"_unit\", \"_role\", \"_vehicle\", \"_turret\", \"_isEject\"];\n}];\n```\n\n- unit: Object - unit the event handler is assigned to\n- role: String - can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n- vehicle: Object - vehicle that the unit left\n- turret: Array - turret path\n- Arma 3 v2.14 isEject: Boolean - true if unit used 'Eject' action\n\n#### HandleDamage\n\nGlobal Argument\n\nTriggers when the unit is damaged and fires for each damaged selection separately\nWorks with all vehicles.\nThis EH can accept a remote unit as argument however it will only fire when the unit is local to the PC this event handler was added on.\nFor example, you can add this event handler to one particular vehicle on every PC.\nWhen this vehicle gets hit, only EH on PC where the vehicle is currently local will fire.\n\nIf the provided code returns a numeric value, this value will overwrite the default damage of given selection after processing.\nIf no value is returned, the default damage processing will be done - this allows for safe stacking of this event handler.\nOnly the return value of the last added \"HandleDamage\" EH is considered.\n\n> [!IMPORTANT]\n> A return value of 0 will make the unit **invulnerable** if damage is not scripted in other ways (i.e using setDamage and/or setHit for additional damage handling).\n> The return value is the hit zone's **absolute damage value**, **not** the damage to be *added* to it.\n\n**Notes:**\n- Multiple \"HandleDamage\" EHs can be added to the same unit. If multiple EHs return damage value for custom damage handling, only last returned value will be considered by the engine.\nEHs that do not return value can be safely added after EHs that do return value.\n- You can save the last event as timestamp (diag_tickTime) onto the unit, as well as the current health of the unit/its selections, with setVariable and query it on each \"HandleDamage\" event with getVariable to define a system how to handle the \"HandleDamage\" event.\n- \"HandleDamage\" will continue to trigger even if the unit is already dead.\n- \"HandleDamage\" is persistent. If you add it to the player object, it will continue to exist after player respawned.\n- \"HandleDamage\" can trigger \"twice\" per damage event. Once for direct damage, once for indirect damage (explosive damage). This can happen even in the same frame, but is unlikely.\n- Use setMissionOptions to filter out no damage calls or fake head hit.\n\nAdditional [Celery's explanation (Updated by ShadowRanger for Arma 3)](https://forums.bistudio.com/forums/topic/205515-handledamage-event-handler-explained/).\n\n```sqf\nthis addEventHandler [\"HandleDamage\", {\n    params [\"_unit\", \"_selection\", \"_damage\", \"_source\", \"_projectile\", \"_hitPartIndex\", \"_instigator\", \"_hitPoint\", \"_directHit\", \"_context\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- selection: String - name of the selection where the unit was damaged.\n  - \"\" for overall structural damage\n  - \"?\" for unknown selections\n- damage: Number - resulting level of damage for the selection\n- source: Object - the source unit that caused the damage\n- projectile: String - classname of the projectile that caused inflicted the damage. (\"\" for unknown, such as fall damage)\n- Arma 3 v1.50 hitPartIndex: Number - hit part index of the hit point, -1 otherwise\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger\n- Arma 3 v1.68 hitPoint: String - hit point Cfg name\n- Arma 3 v2.12 directHit: Boolean - true for direct projectile damage, false for explosion splash damage and all other kinds of damage like fall damage, fire damage, collision damage, etc.\n- Arma 3 v2.16 context: Number - some additional context for the event:\n\n0 : TotalDamage - total damage adjusted before iteration through hitpoints\n\n1 : HitPoint - some hit point processed during iteration\n\n2 : LastHitPoint - the last hitpoint from iteration is processed\n\n3 : FakeHeadHit - head hit that is added/adjusted\n\n4 : TotalDamageBeforeBleeding - total damage is adjusted before calculating bleeding\n\n> [!NOTE]\n> Between an unknown version (confirmed in Arma 3 v1.70) until v1.78 HandleDamage event triggered for every selection of a vehicle, no matter if the section was damaged or not.\n\n#### HandleHeal\n\nGlobal Argument\n\nTriggered when unit starts healing process (player using heal action on self or other unit, scripted action or AI heals after being ordered or on its own).\nThis event handler must be added to the 'injured' (could be added to Init field in editor) and in multiplayer will trigger only on PC where 'healer' is local. If code returns anything but true, engine side healing follows, otherwise healing is aborted.\n\n> [!IMPORTANT]\n> When AI unit is ordered (or acts at own accord) to heal at a medical vehicle and the event handler returns true, the healing is canceled but AI will try again and again and again. The event handler in this case will fire every second until AI unit is healed by other means.\n\n**NOTE**: This Event Handler was broken before Arma 3 v2.18.\n\n```sqf\nthis addEventHandler [\"HandleHeal\", {\n    _this spawn {\n        params [\"_injured\", \"_healer\", \"_isMedic\", \"_atVehicle\", \"_action\"];\n        private _damage = damage _injured;\n        if (_injured == _healer) then\n        {\n            waitUntil { damage _injured != _damage };\n            if (damage _injured < _damage) then\n            {\n                _injured setDamage 0;\n            };\n        };\n    };\n}];\n```\n\n```sqf\nthis addEventHandler [\"HandleHeal\", {\n    params [\"_injured\", \"_healer\", \"_isMedic\", \"_atVehicle\", \"_action\"];\n}];\n```\n\n- injured: Object - unit EH is attached to\n- healer: Object - unit that does the healing (could be the same unit as 'injured')\n- isMedic: Boolean - true when healer is 'Medic'\n- Arma 3 v2.18 atVehicle: Object - when healing at medical vehicle, this is the vehicle\n- Arma 3 v2.18 action: String - the action that triggered the event handler, for example \"SoldierHealSelf\"\n\n#### HandleIdentity\n\nGlobal Argument\n\nTriggered whenever an entity is created. Can be used in scripts if EH is added immediately after unit is created in unscheduled environment.\nDoesn't trigger for editor placed units. Does not work in Multiplayer. If EH scope returns true, the default engine identity application is overridden.\n\n```sqf\nbob = group player createUnit [typeOf player, position player, [], 0, \"NONE\"];\nbob addEventHandler [\"HandleIdentity\", {\n    params [\"_unit\"];\n    hint str _unit;\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n\n#### HandleRating (Arma 3 v1.32)\n\nLocal Argument\n\nTriggered when engine adds rating to overall rating of the unit, usually after a kill or a friendly kill.\nIf EH code returns Number, this will override default engine behaviour and the resulting value added will be the one returned by EH code.\n\n```sqf\nthis addEventHandler [\"HandleRating\", {\n    params [\"_unit\", \"_rating\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- rating: Number - rating to be added\n\n#### HandleScore (Arma 3 v1.32)\n\nGlobal ArgumentServer Execution\n\nTriggered when engine adds score to overall score of the unit, usually after a kill.\nIf the EH code returns Nothing or true, the default engine scoreboard update (score, vehicle kills, infantry kills, etc) is applied, if it returns false, the engine update is cancelled. To add or modify score, use addScore and addScoreSide commands.\nFor remote units like players, the event does not persist after respawn, and must be re-added to the new unit.\n\n**Note:** MP only.\n\n```sqf\nthis addEventHandler [\"HandleScore\", {\n    params [\"_unit\", \"_object\", \"_score\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- object: Object - object for which score was awarded\n- score: Number - score to be added\n\n#### Hit\n\nLocal Argument\n\nTriggered when the unit is hit/damaged.\n\nIs *not* always triggered when unit is killed by a hit.\n\nMost of the time only the killed event handler is triggered when a unit dies from a hit.\n\nThe hit EH will not necessarily fire if only minor damage occurred (e.g. firing a bullet at a tank), even though the damage increased.\n\nDoes not fire when a unit is set to allowDamage false.\n\n```sqf\nthis addEventHandler [\"Hit\", {\n    params [\"_unit\", \"_source\", \"_damage\", \"_instigator\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- source: Object - object that caused the damage – contains *unit* in case of collisions\n- damage: Number - level of damage caused by the hit\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger\n\n#### HitPart (Entity)\n\nGlobal Argument\n\nTriggered when the object it was added to gets damaged.\nIt returns the position and component that was hit on the object within a nested array, this is because the model may have more than one selection name for the hit component (i.e. a single piece of geometry can be simultaneously part of multiple, overlapping named selections).\n\nWhile you can add \"HitPart\" handler to a remote unit, the respective addEventHandler command must be executed on the shooter's PC and will only fire on shooter's PC as well.\nThe event will not fire if the shooter is not local, even if the target itself is local.\nAdditionally, if the unit gets damaged by any means other than ammunition or explosions, such as fall damage and burning, \"HitPart\" will not fire.\nBecause of this, this event handler is most suitable for when the shooter needs feedback on his shooting, such as target practicing or hitmarker creation.\n\nThis EH returns an array of arrays. Each sub-array contains data for the part that was hit as usually multiple parts are hit at the same time (see HitPart Sample). The structure of the sub-arrays is listed below.\n\n```sqf\nthis addEventHandler [\"HitPart\", {\n    {\n        _x params [\n            \"_target\", \"_shooter\", \"_projectile\", \"_position\", \"_velocity\",\n            \"_selection\", \"_ammo\", \"_vector\", \"_radius\", \"_surfaceType\",\n            \"_isDirect\", \"_instigator\"\n        ];\n    } forEach _this;\n}];\n```\n\n- target: Object - object that was damaged\n- shooter: Object - Unit or vehicle that inflicted the damage. If injured by a vehicle collision, the target itself is returned, or objNull in case of explosions. In case of explosives that were planted by someone (e.g. satchel charges), that unit is returned.\n- projectile: Object - object that was fired\n- position: Array format PositionASL - position the bullet impacted\n- velocity: Vector3D - 3D speed at which the bullet impacted\n- selection: Array - array of Strings with named selection of the object that were hit, in the FireGeometry LOD\n- ammo:\n  - Array in format [hitValue, indirectHitValue, indirectHitRange, explosiveDamage, ammoClassName] - If the damage was directly or indirectly inflicted by a projectile. Hit and damage values are derived from the projectile's CfgAmmo class, and do not match the actual damage inflicted, which is usually lower due to armor and other factors.\n  - Array in format [impulseValue, 0, 0, 0] - if the damage was inflicted by a vehicle collision\n- vector: Vector3D - Vector that is orthogonal (perpendicular) to the surface struck. For example, if a wall was hit, the vector would be pointing out of the wall at a 90 degree angle.\n- radius: Number - radius (size) of component hit\n- surfaceType: String - surface type struck\n- isDirect: Boolean - true if object was directly hit, false if it was hit by indirect / splash damage\n- Arma 3 v2.18 instigator: Object - shot instigator\n\n> [!NOTE]\n> See #HitPart (Projectile) for a similar event handler that is attached to the projectile instead of the entity.\n\n> [!NOTE]\n> This event does not fire when miniscule explosive damage is dealt to the target entity, but the Explosion event will still fire.\n\n#### IncomingMissile\n\nGlobal Argument\n\nTriggered when a unit fires a missile or rocket at the target. For projectiles fired by players this EH only triggers for guided missiles that have locked onto the target.\n\n```sqf\nthis addEventHandler [\"IncomingMissile\", {\n    params [\"_target\", \"_ammo\", \"_vehicle\", \"_instigator\", \"_missile\"];\n}];\n```\n\n- target: Object - object the event handler is assigned to\n- ammo: String - ammo type that was fired on the target\n- Arma 3 v1.42 vehicle: Object - vehicle that fired the weapon. In case of soldier, unit is returned\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger\n- Arma 3 v2.10 missile: Object - the incoming missile\n\n#### Init (Entity)\n\nGlobal Argument\n\nTriggered whenever an entity is created. Cannot be used in scripts, only inside class Eventhandlers in config.\n\n> [!IMPORTANT]\n> It is recommended to use the #PostInit event handler instead of this one when setting entity textures (setObjectTexture, BIS_fnc_initVehicle etc) to avoid networking issues.\n\ne.g:\n\n```cpp\ninit = \"params ['_entity'];\";\n```\n\n```sqf\nparams [\"_entity\"];\n```\n\n- entity: Object - object the event handler is assigned to\n\n#### InventoryClosed (Arma 3 v1.22)\n\nGlobal Argument\n\nTriggered when the unit closes inventory. Said unit can be non-local when adding the EH, but **must** be local for the EH to trigger.\n\n```sqf\nthis addEventHandler [\"InventoryClosed\", {\n    params [\"_unit\", \"_container\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- container: Object - connected container or weaponholder\n\n```sqf\n// Delete dropped items when inventory closed\nplayer addEventHandler [\"InventoryClosed\", {\n    params [\"_unit\", \"_container\"];\n    if (_container isKindOf \"WeaponHolder\") then\n    {\n        deleteVehicle _container;\n    };\n}];\n```\n\n#### InventoryOpened (Arma 3 v1.22)\n\nGlobal Argument\n\nTriggered when unit opens inventory. Said unit can be non-local when adding the EH, but **must** be local for the EH to trigger. End EH main scope with true to override the opening of the inventory in case you wish to handle it yourself:\n\n```sqf\n// Create and open an ammo box when \"Inventory\" button is pressed\nplayer addEventHandler [\"InventoryOpened\", {\n    player removeAllEventHandlers \"InventoryOpened\";\n    _box = \"Box_NATO_Ammo_F\" createVehicle [0,0,0];\n    _box setPosASL (player modelToWorldVisualWorld [0,1.5,0.5]);\n    player action [\"Gear\", _box];\n    true; // <-- inventory override\n}];\n```\n\nTo return all nearby containers use nearSupplies command.\n\n```sqf\nthis addEventHandler [\"InventoryOpened\", {\n    params [\"_unit\", \"_primaryContainer\", \"_secondaryContainer\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- primaryContainer: Object - connected container or weaponholder\n- Arma 3 v1.66 secondaryContainer: Object - second connected container or weaponholder or objNull\n\n#### Killed\n\nLocal Argument\n\nTriggered when the unit is killed.\n\n```sqf\nthis addEventHandler [\"Killed\", {\n    params [\"_unit\", \"_killer\", \"_instigator\", \"_useEffects\", \"_shot\", \"_real\"];\n}];\n```\n\n- unit: Object - the object the event handler is assigned to\n- killer: Object - the object that killed the unit. Contains the unit itself in case of collisions.\n- Arma 3 v1.66 instigator: Object - the person who pulled the trigger\n- Arma 3 v1.68 useEffects: Boolean - same as *useEffects* in setDamage alt syntax\n- Arma 3 v2.22 shot: Object - shot that caused damage\n- Arma 3 v2.22 real: Boolean - true when the shot was 'real' where the event handler triggered\n\n#### LandedStopped\n\nGlobal Argument\n\nTriggered when an AI pilot would get out usually. Not executed for player.\n\n```sqf\nthis addEventHandler [\"LandedStopped\", {\n    params [\"_plane\", \"_airportID\", \"_airportObject\"];\n}];\n```\n\n- plane: Object - object the event handler is assigned to\n- airportID: Number - ID of the airport (-1 for anything else)\n- Arma 3 v2.12 airportObject: Object - airport object in the event of a Dynamic Airport, otherwise objNull\n\n#### LandedTouchDown\n\nGlobal Argument\n\nTriggered when a plane (AI or player) touches the ground.\n\n```sqf\nthis addEventHandler [\"LandedTouchDown\", {\n    params [\"_plane\", \"_airportID\", \"_airportObject\"];\n}];\n```\n\n- plane: Object - object the event handler is assigned to\n- airportID: Number - ID of the airport (-1 for anything else)\n- Arma 3 v2.12 airportObject: Object - airport object in the event of a Dynamic Airport, otherwise objNull\n\n#### Landing (Arma 3 v1.70)\n\nGlobal Argument\n\nTriggered when an AI pilot (or auto-pilot) is preparing for landing. The exact moment of triggering coincides with lowering of the gear (\"Gear\" EH)\n\n```sqf\nthis addEventHandler [\"Landing\", {\n    params [\"_plane\", \"_airportID\", \"_isCarrier\"];\n}];\n```\n\n- plane: Object - object the event handler is assigned to\n- airportID: Number or Object - ID of the airport or aircraft carrier object\n- isCarrier: Boolean - true if landing on aircraft carrier\n\n#### LandingCanceled (Arma 3 v1.70)\n\nGlobal Argument\n\nTriggered when AI pilot landing is cancelled (for example new order received to land elsewhere).\nThe exact moment of triggering coincides with retracting of the gear (\"Gear\" EH).\n\n**Note**: Does not trigger if player switches off auto-pilot. Canceled is spelled with one `L`\n\n```sqf\nthis addEventHandler [\"LandingCanceled\", {\n    params [\"_plane\", \"_airportID\", \"_isCarrier\"];\n}];\n```\n\n- plane: Object - object the event handler is assigned to\n- airportID: Number or Object - ID of the airport or aircraft carrier object (-1 no airport)\n- isCarrier: Boolean - true if landing on aircraft carrier\n\n#### LaserTargetChanged (Arma 3 v2.22)\n\nTriggered when the laser target changes.\n\n```sqf\nthis addEventHandler [\"LaserTargetChanged\", {\n    params [\"_unit\", \"_laserTarget\", \"_designatedTarget\", \"_turretPath\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- laserTarget: Object - the laser target entity that got created at impact point\n- designatedTarget: Object - the object that is targeted by the laser\n- turretPath: Turret Path - the path to the turret that activated the laser. It is empty when the event is triggered by a unit\n\n#### LeaningChanged (Arma 3 v2.18)\n\nGlobal Argument\n\nTriggered when a soldier leaning factor is changed between -1 (extreme left), 0 (not leaning) and 1 (extreme right)\n\n```sqf\nthis addEventHandler [\"LeaningChanged\", {\n    params [\"_unit\", \"_newLeaning\", \"_oldLeaning\"];\n}];\n```\n\n- unit: Object - soldier\n- newLeaning: Number from -1 to 1\n- oldLeaning: Number from -1 to 1\n\n#### Local (Entity)\n\nGlobal Argument\n\nTriggers when locality of object in MP is changed. The event handler only triggers on the computers that are directly involved in change of locality.\nSo if EH is added to every computer on network, it will only trigger on 2 computers, on the computer that receives ownership of the object (new owner), in which case _this select 1 will be true,\nand on the computer from which ownership is transferred (old owner), in which case _this select 1 will be false.\n\n```sqf\nthis addEventHandler [\"Local\", {\n    params [\"_entity\", \"_isLocal\"];\n}];\n```\n\n- entity: Object - the object that changed locality\n- isLocal: Boolean - if the object is local on given computer\n\n#### MagazineReloading (Arma 3 v2.18)\n\nLocal Argument\n\nTriggers when reloading starts.\n\n```sqf\nthis addEventHandler [\"MagazineReloading\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_magazine\", \"_magazineClass\", \"_ammoCount\", \"_magazineID\", \"_magazineCreator\"];\n}];\n```\n\n- unit: Object - unit or vehicle to which EH is assigned\n- weapon: String - weapon that got unloaded\n- muzzle: String - weapon's muzzle that got unloaded\n- magazine: Array - magazine info in format [magazineClass, ammoCount, magazineID, magazineCreator], where:\n  - magazineClass: String - class name of the magazine\n  - ammoCount: Number - amount of ammo in magazine\n  - magazineID: Number - global magazine id\n  - magazineCreator: Number - owner of the magazine creator\n\n#### MagazineUnloaded (Arma 3 v2.18)\n\nLocal Argument\n\nTriggers when a magazine is removed from a weapon manually or via script.\n\n```sqf\nthis addEventHandler [\"MagazineUnloaded\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_magazine\", \"_magazineClass\", \"_ammoCount\", \"_magazineID\", \"_magazineCreator\"];\n}];\n```\n\n- unit: Object - unit or vehicle to which EH is assigned\n- weapon: String - weapon that got unloaded\n- muzzle: String - weapon's muzzle that got unloaded\n- magazine: Array - magazine info in format [magazineClass, ammoCount, magazineID, magazineCreator], where:\n  - magazineClass: String - class name of the magazine\n  - ammoCount: Number - amount of ammo in magazine\n  - magazineID: Number - global magazine id\n  - magazineCreator: Number - owner of the magazine creator\n\n#### OpticsModeChanged (Arma 3 v2.10)\n\nLocal Argument\n\nTriggers everytime a local unit changes optic mode. This could be either through the setOpticsMode command or by the player switching to the next optic mode using e.g <kbd>NUM /</kbd> or <kbd>Ctrl</kbd>+<kbd>RMB</kbd>.\n\n```sqf\nthis addEventHandler [\"OpticsModeChanged\", {\n    params [\"_unit\", \"_opticsClass\", \"_newMode\", \"_oldMode\", \"_isADS\"];\n}];\n```\n\n- unit: Object - the unit\n- opticsClass: String\n- newMode: String\n- oldMode: String\n- isADS: Boolean - if the new view is GUNNER\n\n#### OpticsSwitch (Arma 3 v2.10)\n\nLocal Argument\n\nTriggers at the start of the camera transition from GUNNER to INTERNAL/EXTERNAL and vice-versa.\nSo anytime the right mouse button is pressed and there is a GUNNER view available or are currently in it, this triggers.\nWorks in vehicles and FFV as well. See also cameraView.\n\n```sqf\nthis addEventHandler [\"OpticsSwitch\", {\n    params [\"_unit\", \"_isADS\"];\n}];\n```\n\n- unit: Object - the unit\n- isADS: Boolean - if the new view is GUNNER\n\n#### PathCalculated (Arma 3 v1.94)\n\nLocal Argument\n\nTriggers when a path has been calculated for the unit. Works for both agents and normal AI units.\n\nNote that paths to far destinations are typically calculated in segments.\nWhen the unit completes a segment, a new path is calculated and this is continued until the unit reaches its destination.\n\n```sqf\nthis addEventHandler [\"PathCalculated\", {\n    params [\"_unit\", \"_path\"];\n}];\n```\n\n- unit: Object - the unit/agent for which the path was calculated\n- path: Array - the array of positions representing the path (PositionASL)\n\n#### PeriscopeElevationChanged (Arma 3 v2.00)\n\nFires every frame during periscope elevation animation.\n\n```sqf\nthis addEventHandler [\"PeriscopeElevationChanged\", {\n    params [\"_vehicle\", \"_turret\", \"_elevation\", \"_direction\", \"_userIsBlocked\"];\n}];\n```\n\n- vehicle: Object - the vehicle this EH is assigned to\n- turret: Array - the turret which periscope is changing elevation\n- elevation: Number - current periscope elevation (changes with each simulation). See also periscopeElevation, elevatePeriscope\n- direction: Number - 1: moves up, 0: stopped, -1: moves down; when `direction` returns 0, this also means the event handler fired for the last time for this elevation.\n- userIsBlocked: Boolean - whether or not the user ability to override is blocked. See also periscopeElevation, elevatePeriscope\n\n#### PostInit (Arma 3 v2.06)\n\nGlobal Argument\n\nTriggered whenever an entity is created and initialized. Cannot be used in scripts, only inside class Eventhandlers in config.\n\n> [!IMPORTANT]\n> It is recommended to use this event handler instead of the #Init one when setting entity textures (setObjectTexture, BIS_fnc_initVehicle etc) to avoid networking issues.\n\ne.g:\n\n```cpp\npostInit = \"params ['_entity'];\";\n```\n\n```cpp\npostinit = \"params ['_entity']; if (local _entity) then { [_entity, '', [], false] call BIS_fnc_initVehicle };\";\n```\n\n```sqf\nparams [\"_entity\"];\n```\n\n- entity: Object - object the event handler is assigned to\n\n#### PostReset\n\n**Obsolete** - triggers after PP effects have been reset by the engine.\n\n#### Put (Arma 3 v0.56)\n\nGlobal Argument\n\nTriggers when a unit puts an item in a container.\n\nArma 3 v2.14 This event handler can be added to a container.\n\n```sqf\nthis addEventHandler [\"Put\", {\n    params [\"_unit\", \"_container\", \"_item\"];\n}];\n```\n\n- unit: Object - unit who put the item in the container\n- container: Object - the container into which the item was placed (vehicle, box, etc.)\n- item: String - the class name of the moved item\n\n> [!NOTE]\n> This EH could also trigger when unit replaces magazine in weapon with another magazine from unit containers (uniform, vest, backpack) during reload.\n\n#### PylonChanged (Arma 3 v2.20)\n\nLocal Argument\n\nTriggers when an aircraft's pylon changes magazine type:\n\n```sqf\nvehicle player addEventHandler [\"PylonChanged\", {\n    params [\"_vehicle\", \"_pylonIndex\", \"_oldMagazine\", \"_newMagazine\"];\n}];\n```\n\n- vehicle: Object\n- pylonIndex: Number\n- oldMagazine: String\n- newMagazine: String\n\n> [!IMPORTANT]\n> This event generally triggers **twice** for a swap, first unload then load, e.g:\n>\n> ```sqf\n> // [myVehicle, 1, \"oldMagClass\", \"\"]\n> // [myVehicle, 1, \"\", \"newMagClass\"]\n> ```\n\n#### Reloaded (Arma 3 v1.58)\n\nLocal Argument\n\nTriggers once a weapon is reloaded with a new magazine. For more information, see Reloaded.\n\n```sqf\nthis addEventHandler [\"Reloaded\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_newMagazine\", \"_oldMagazine\"];\n}];\n```\n\n- unit: Object - unit or vehicle to which EH is assigned\n- weapon: String - weapon that got reloaded\n- muzzle: String - weapon's muzzle that got reloaded\n- newMagazine: Array - new magazine info\n- oldMagazine: Array or Nothing - old magazine info\n\n#### Respawn\n\nLocal Argument\n\nTriggered when a unit respawns.\n\n```sqf\nthis addEventHandler [\"Respawn\", {\n    params [\"_unit\", \"_corpse\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- corpse: Object - object the event handler was assigned to, aka the corpse/unit player was previously controlling\n\n#### RopeAttach (Arma 3 v1.34)\n\nTriggered when a rope is attached to an object.\n\nIn the case of sling loading, this event handler must be assigned to the helicopter and will trigger for each attached rope.\n\n```sqf\nthis addEventHandler [\"RopeAttach\", {\n    params [\"_object1\", \"_rope\", \"_object2\"];\n}];\n```\n\n- object1: Object - object to which the event handler is assigned.\n- rope: Object - the rope being attached between object 1 and object 2.\n- object2: Object - the object that is being attached to object 1 via rope.\n\n#### RopeBreak (Arma 3 v1.34)\n\nTriggered when a rope is detached from an object.\n\nIn the case of sling loading, this event handler must be assigned to the helicopter and will trigger for each detached rope.\n\n```sqf\nthis addEventHandler [\"RopeBreak\", {\n    params [\"_object1\", \"_rope\", \"_object2\"];\n}];\n```\n\n- object1: Object - object to which the event handler is assigned.\n- rope: Object - the rope that connected object 1 and object 2.\n- object2: Object - the object that was connected to object 1 with a rope.\n\n#### SeatSwitched (Arma 3 v1.50)\n\nGlobal Argument\n\nTriggered when unit changes seat within vehicle. EH returns both units switching seats.\nIf switching seats with an empty seat, one of the returned units will be objNull.\nThe new position can be obtained with assignedVehicleRole.\nThis EH must be assigned to a vehicle.\n\n```sqf\nthis addEventHandler [\"SeatSwitched\", {\n    params [\"_vehicle\", \"_unit1\", \"_unit2\"];\n}];\n```\n\n- vehicle: Object - vehicle to which the event handler is assigned.\n- unit1: Object - unit switching seat.\n- unit2: Object - unit switching seat.\n\n#### SeatSwitchedMan (Arma 3 v1.58)\n\nGlobal Argument\n\nTriggered when unit changes seat within vehicle. EH returns both units switching seats.\nIf switching seats with an empty seat, one of the returned units will be objNull.\nThe new position can be obtained with assignedVehicleRole <unit>. This EH must be assigned to a unit and not a vehicle.\nThis EH is persistent and will be transferred to the new unit after respawn, but only if it was assigned where unit was local.\n\n```sqf\nthis addEventHandler [\"SeatSwitchedMan\", {\n    params [\"_unit1\", \"_unit2\", \"_vehicle\"];\n}];\n```\n\n- unit1: Object - unit switching seat.\n- unit2: Object - unit with which unit1 is switching seat.\n- vehicle: Object - vehicle where switching seats is taking place.\n\n#### SelectedActionChanged\n\nRTM helicopter user action event\n\n```sqf\nthis addEventHandler [\"SelectedActionChanged\", {\n    params [\"_caller\", \"_target\", \"_enumNumber\", \"_actionId\"];\n}];\n```\n\n> [!IMPORTANT]\n> Limited or non-existent functionality.\n\n#### SelectedActionPerformed\n\nRTM helicopter user action event\n\n```sqf\nthis addEventHandler [\"SelectedActionPerformed\", {\n    params [\"_caller\", \"_target\", \"_enumNumber\", \"_actionId\"];\n}];\n```\n\n> [!IMPORTANT]\n> Limited or non-existent functionality.\n\n#### SelectedRotorLibActionChanged\n\nRTM helicopter user action event\n\n```sqf\nthis addEventHandler [\"SelectedRotorLibActionChanged\", {\n    params [\"_caller\", \"_target\", \"_enumNumber\", \"_actionId\"];\n}];\n```\n\n> [!IMPORTANT]\n> Limited or non-existent functionality.\n\n#### SelectedRotorLibActionPerformed\n\nRTM helicopter user action event\n\n```sqf\nthis addEventHandler [\"SelectedRotorLibActionPerformed\", {\n    params [\"_caller\", \"_target\", \"_enumNumber\", \"_actionId\"];\n}];\n```\n\n> [!IMPORTANT]\n> Works only for key press combination <kbd>RCtrl</kbd>+<kbd>W</kbd>, which is the binding for helicopter wheels brakes.\n> It fires with or without Advanced Flight Model enabled. The enum number returned is 4 and 5, probably because the enum is structured like this:\n> - 0: HelicopterAutoTrimOn\n> - 1: HelicopterAutoTrimOff\n> - 2: HelicopterTrimOn\n> - 3: HelicopterTrimOff\n> - 4: WheelsBrakeOn\n> - 5: WheelsBrakeOff\n\n#### SlotItemChanged (Arma 3 v2.14)\n\nGlobal Argument\n\nTriggered when any of the following slots get assigned or unassigned: *Items* - Map, GPS, Radio, Watch, Compass, Helmet, Goggles, NVG; *Weapon* - Binoculars; *Containers* - Uniform, Vest, Backpack.\n\n```sqf\nthis addEventHandler [\"SlotItemChanged\", {\n    params [\"_unit\", \"_name\", \"_slot\", \"_assigned\", \"_weapon\"];\n}];\n```\n\n- unit: Object - unit EH assigned to.\n- name: String - name of the item/weapon/container (see getSlotItemName).\n- slot: Number - slot id (see getSlotItemName).\n- assigned: Boolean - true assign action, false unassign action.\n- Arma 3 v2.18 weapon: String - name of weapon in event that slot changed is a weapon attachment slot\n\n#### SoundPlayed (Arma 3 v0.56)\n\nLocal Argument\n\nTriggered when player is making noises when injured or fatigued for example. The number param passed to the EH code points to the sound origin:\n1. Breath\n1. Breath Injured\n1. Breath Scuba\n1. Injured\n1. Pulsation\n1. Hit Scream\n1. Burning\n1. Drowning\n1. Drown\n1. Gasping\n1. Stabilizing\n1. Healing\n1. Healing With Medikit\n1. Recovered\n1. Breath Held\n\n```sqf\nthis addEventHandler [\"SoundPlayed\", {\n    params [\"_unit\", \"_soundID\"];\n}];\n```\n\n- unit: Object - unit to which the event handler is assigned\n- soundID: Number - sound origin\n\n> [!NOTE]\n> Since Arma 3 v2.12 returning a Number from last added EH in range from 0 to 5 will alter the volume of played sound from mute to max volume.\n\n#### Suppressed (Arma 3 v2.02)\n\nLocal Argument\n\nTriggers when enemy projectile is passing by closer than defined suppression radius ammo value in config.\nCan be made to trigger for the same side if the side is set as enemy to itself (with setFriend). For more information see Arma 3: Suppression.\n\n```sqf\nthis addEventHandler [\"Suppressed\", {\n    params [\"_unit\", \"_distance\", \"_shooter\", \"_instigator\", \"_ammoObject\", \"_ammoClassName\", \"_ammoConfig\"];\n}];\n```\n\n- unit: Object - unit to which the event is assigned\n- distance: Number - distance of the projectile pass-by\n- shooter: Object - who (or what) fired - vehicle or drone\n- instigator: Object - who pressed the trigger. Instigator is different from the shooter when player is operator of UAV for example\n- ammoObject: Object - the ammunition itself\n- ammoClassName: String - the ammunition's classname\n- ammoConfig: Config - the ammunition's CfgAmmo config path\n\n#### Take (Arma 3 v0.56)\n\nGlobal Argument\n\nTriggers when a unit takes an item from a container.\n\nArma 3 v2.14 This event handler can be added to a container.\n\n```sqf\nthis addEventHandler [\"Take\", {\n    params [\"_unit\", \"_container\", \"_item\"];\n}];\n```\n\n- unit: Object - unit who took the item from the container\n- container: Object - the container from which the item was taken (vehicle, box, etc.)\n- item: String - the class name of the taken item\n\n> [!NOTE]\n> This EH could also trigger when unit replaces magazine in weapon with another magazine from unit containers (uniform, vest, backpack) during reload.\n\n#### TaskSetAsCurrent (Arma 3 v1.32)\n\nTriggers when player's current task changes\n\n```sqf\nthis addEventHandler [\"TaskSetAsCurrent\", {\n    params [\"_unit\", \"_task\"];\n}];\n```\n\n- unit: Object - the player to whom the event handler is assigned\n- task: Task - the new current task\n\n#### TurnIn (Arma 3 v1.66)\n\nTriggers when member of crew in a vehicle uses Turn In action\n\n```sqf\nthis addEventHandler [\"TurnIn\", {\n    params [\"_vehicle\", \"_unit\", \"_turret\"];\n}];\n```\n\n- vehicle: Object - the vehicle the event handler is assigned to\n- unit: Object - the unit performing the Turn In action\n- turret: Array - turret path\n\n#### TurnOut (Arma 3 v1.66)\n\nTriggers when member of crew in a vehicle uses Turn Out action\n\n```sqf\nthis addEventHandler [\"TurnOut\", {\n    params [\"_vehicle\", \"_unit\", \"_turret\"];\n}];\n```\n\n- vehicle: Object - the vehicle the event handler is assigned to\n- unit: Object - the unit performing the Turn Out action\n- turret: Array - turret path\n\n#### VisionModeChanged (Arma 3 v2.08)\n\nTriggers when the assigned vehicle/unit's vision mode has changed.\n\n```sqf\nplayer addEventHandler [\"VisionModeChanged\", {\n    params [\"_person\", \"_visionMode\", \"_TIindex\", \"_visionModePrev\", \"_TIindexPrev\", \"_vehicle\", \"_turret\"];\n}];\n```\n\n- person: Object - unit for whom the vision mode changes\n- visionMode: Number - vision mode index\n- TIindex: Number - thermal vision mode index; will return -1 when *visionMode* is not 2\n- visionModePrev: Number - last vision mode\n- TIindexPrev: Number - last TI mode; will return -1 when *visionModePrev* is not 2\n- vehicle: Object - if unit is in a vehicle or controlling a UAV, this will be the vehicle\n- turret: Array - turret path to the turret occupied by the unit, or [] if not on turret\n\n#### WeaponAssembled\n\nGlobal Argument\n\nTriggers when a weapon gets assembled. EH must be attached to the unit and not the weapon.\n\n```sqf\nthis addEventHandler [\"WeaponAssembled\", {\n    params [\"_unit\", \"_weapon\", \"_primaryBag\", \"_secondaryBag\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- weapon: Object - object of the assembled weapon\n- Arma 3 v2.18 primaryBag: Object - primary bag (just before it is deleted)\n- Arma 3 v2.18 secondaryBag: Object - secondary bag (just before it is deleted)\n\n#### WeaponChanged (Arma 3 v2.18)\n\nFires on weapon switch and firemode switch. Does not fire for player units inside vehicles (but does fire for vehicles with players in them).\n\nThe locality is unknown, but it is known that this EH behaves like currentWeapon, currentWeaponMode and currentMuzzle in terms of locality.\n\nArma 3 v2.22 Fires for \"Throw\" muzzle changes too.\n\n```sqf\nthis addEventHandler [\"WeaponChanged\", {\n    params [\"_object\", \"_oldWeapon\", \"_newWeapon\", \"_oldMode\", \"_newMode\", \"_oldMuzzle\", \"_newMuzzle\", \"_turretIndex\"];\n}];\n```\n\n- object: Object - the unit or vehicle the event handler is assigned to\n- oldWeapon: String - the class name of the previous weapon\n- newWeapon: String - the class name of the new weapon (same as currentWeapon)\n- oldMode: String - the previous weapon mode\n- newMode: String - the new weapon mode (same as currentWeaponMode)\n- oldMuzzle: String - the previous weapon muzzle\n- newMuzzle: String - the new weapon muzzle (same as currentMuzzle)\n- turretIndex: Array format Turret Path - the turret path, or empty array if `object` is not a transport vehicle\n\n#### WeaponDeployed (Arma 3 v1.44)\n\nGlobal Argument\n\nTriggers when the deployed state of a weapon or bipod changes.\n\n**Note:** A weapon cannot be rested and deployed at the same time.\n\n```sqf\nthis addEventHandler [\"WeaponDeployed\", {\n    params [\"_unit\", \"_isDeployed\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- isDeployed: Boolean - true if deployed\n\n#### WeaponDisassembled\n\nGlobal Argument\n\nTriggers when a weapon gets disassembled. EH must be attached to the unit and not the weapon.\n\n**Note:** As of Arma 3 v1.32, this event does not fire if the weapon is not local.\n\n```sqf\nthis addEventHandler [\"WeaponDisassembled\", {\n    params [\"_unit\", \"_primaryBag\", \"_secondaryBag\", \"_weapon\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- primaryBag: Object - first backpack object which was weapon disassembled into\n- secondaryBag: Object - second backpack object which was weapon disassembled into\n- Arma 3 v2.18 weapon: Object - disassembled weapon (just before it is moved out of the world)\n\n#### WeaponRested (Arma 3 v1.44)\n\nLocal Argument\n\nTriggers when weapon rested state changes (weapon near a surface that can provide weapon support).\n\n**Note:** A weapon cannot be rested and deployed at the same time.\n\n```sqf\nthis addEventHandler [\"WeaponRested\", {\n    params [\"_unit\", \"_isRested\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- isRested: Boolean - true if rested\n\n### Multiplayer Event Handlers\n\nGlobal object event handler, executed on every connected machine.\n\nCommands:\n- addMPEventHandler\n- removeMPEventHandler\n- removeAllMPEventHandlers\n\n> [!IMPORTANT]\n> A Multiplayer Event Handler is **not** saved in a save file and therefore will not be restored on load - use it accordingly.\n\n#### MPHit\n\nGlobal ArgumentGlobal Effect\n\nTriggered when the unit is hit/damaged. EH can be added on any machine and EH code will trigger globally on every connected client and server.\nThis EH is clever enough to be triggered globally only once even if added on all clients or a single client that is then disconnected, EH will still trigger globally only once.\n\nIs *not* always triggered when unit is killed by a hit.\nMost of the time only the killed event handler is triggered when a unit dies from a hit.\nThe hit EH will not necessarily fire if only minor damage occurred (e.g. firing a bullet at a tank), even though the damage increased.\nCan also trigger several times for an explosion (direct and indirect damage). Does not fire when a unit is set to allowDamage false.\nHowever it will fire with \"HandleDamage\" EH added alongside stopping unit from taking damage (`unit addEventHandler [\"HandleDamage\", { 0 }];`.\nWill not trigger once the unit is dead.\n\n**Note:** call a function from the MPHit EH code space rather than defining the full code in there directly.\nThe reason is the code space will be transferred over network on each event activation - so keep the data as small as possible!\n\n```sqf\nthis addMPEventHandler [\"MPHit\", {\n    params [\"_unit\", \"_causedBy\", \"_damage\", \"_instigator\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n\n- causedBy: Object - object that caused the damage. Contains the unit itself in case of collisions.\n\n- damage: Number - level of damage caused by the hit\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger\n\n#### MPKilled\n\nGlobal ArgumentGlobal Effect\n\nTriggered when the unit is killed. EH can be added on any machine and EH code will trigger globally **on every connected client and server**.\nThis EH has a safeguard measure so that even if it's added on all clients or a single client that is then disconnected, EH will still trigger globally only once per client.\n\n```sqf\nthis addMPEventHandler [\"MPKilled\", {\n    params [\"_unit\", \"_killer\", \"_instigator\", \"_useEffects\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- killer: Object - object that killed the unit. Contains the unit itself in case of collisions\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger\n- Arma 3 v1.68 useEffects: Boolean - same as *useEffects* in setDamage alt syntax\n\n#### MPRespawn\n\nGlobal ArgumentLocal Effect\n\nTriggered when a unit, it is assigned to, respawns. This EH does not work as one would expect MP EH should work like.\nIt is only triggered on one machine where the unit it was assigned to is local.\nThe only difference between **Respawn** and **MPRespawn** is that **MPRespawn** can be assigned from anywhere while **Respawn** requires the unit to be local.\n\nMPRespawn EH expects the EH code to return an array in Position format which will be used to place the respawned unit at the desired coordinates.\n\nFor example: `player addMPEventHandler [\"MPRespawn\", { [1234, 1234, 0] }];` will place player at [1234,1234,0] immediately on respawn.\n\n```sqf\nthis addMPEventHandler [\"MPRespawn\", {\n    params [\"_unit\", \"_corpse\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- corpse: Object - object the event handler was assigned to, aka the corpse/unit player was previously controlling.\n\n### Mission Event Handlers\n\nMission Event Handlers are specific EHs that are anchored to the running mission and automatically removed when mission is over.\n\nCommands:\n- addMissionEventHandler\n- removeMissionEventHandler\n\n> [!NOTE]\n> See Arma 3: Mission Event Handlers.\n\n### Curator Event Handlers (Arma 3 v1.16)\n\nLocal ArgumentLocal Effect\n\nArma 3: Curator Event Handlers are also added with the addEventHandler command. They are executed only where the curator is local - on the machine that is in control of it.\n\n> [!IMPORTANT]\n> These Event Handlers must be added to the curator object/module, **not** the player!\n\nCommands:\n- addEventHandler\n- removeEventHandler\n- removeAllEventHandlers\n\n#### CuratorFeedbackMessage\n\nLocal Argument\n\nTriggered when curator attempts invalid action in curator interface.\n\nEach error has its own unique ID, recognized values are:\n\n- 003 - when trying to teleport camera outside of curatorCameraArea\n- 101 - trying to place an object when placing is disabled using setCuratorCoef \"place\"\n- 102 - trying to place an object which is too expensive (cost set in *curatorObjectRegistered* multiplied by setCuratorCoef \"place\" is larger than curatorPoints)\n- 103 - trying to place an object outside of curatorEditingArea\n- 104 - items of a placed composition were skipped / could not be placed (since Arma 3 v2.06)\n- 201 - trying to place a waypoint when waypoint placing is disabled\n- 202 - trying to place a waypoint which is too expensive (cost set by setCuratorWaypointCost multiplied by setCuratorCoef \"place\" is larger than curatorPoints)\n- 206 - trying to place a waypoint when no AI unit is selected\n- 301 - trying to move or rotate an entity when editing is disabled using setCuratorCoef \"edit\"\n- 302 - trying to move or rotate an entity when it is too expensive (entity cost multiplied by setCuratorCoef \"edit\" is larger than curatorPoints)\n- 303 - trying to move an entity outside of curatorEditingArea\n- 304 - trying to move or rotate an entity which is outside of curatorEditingArea\n- 307 - trying to move or rotate a player (players cannot be manipulated with)\n- 401 - trying to delete an entity when deleting is disabled using setCuratorCoef \"delete\"\n- 402 - trying to delete an entity which is too expensive (cost multiplied by setCuratorCoef \"delete\" is larger than curatorPoints)\n- 404 - trying to delete an entity which is outside of curatorEditingArea\n- 405 - trying to delete an entity which has non-editable crew in it\n- 407 - trying to delete a player (players cannot be manipulated with)\n- 501 - trying to destroy an object when destroying is disabled using setCuratorCoef \"destroy\"\n- 502 - trying to destroy an object which is too expensive (cost multiplied by setCuratorCoef \"destroy\" is larger than curatorPoints)\n- 504 - trying to destroy an object which is outside of curatorEditingArea\n- 505 - trying to destroy an object which has non-editable crew in it\n- 506 - trying to destroy an object when no object is selected\n- 507 - trying to destroy a player (players cannot be manipulated with)\n\n```sqf\nthis addEventHandler [\"CuratorFeedbackMessage\", {\n    params [\"_curator\", \"_errorID\"];\n}];\n```\n\n- curator: Object\n- errorID: Number\n\n#### CuratorGroupDoubleClicked\n\nLocal Argument\n\nTriggered when a group is double-clicked on in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorGroupDoubleClicked\", {\n    params [\"_curator\", \"_group\"];\n}];\n```\n\n- curator: Object\n- group: Group\n\n#### CuratorGroupPlaced\n\nLocal Argument\n\nTriggered when new group is placed in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorGroupPlaced\", {\n    params [\"_curator\", \"_group\"];\n}];\n```\n\n- curator: Object\n- group: Group\n\n#### CuratorGroupSelectionChanged\n\nLocal Argument\n\nTriggered when a group is selected in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorGroupSelectionChanged\", {\n    params [\"_curator\", \"_group\"];\n}];\n```\n\n- curator: Object\n- group: Group\n\n#### CuratorMarkerDeleted\n\nLocal Argument\n\nTriggered when a marker is deleted in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerDeleted\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String\n\n#### CuratorMarkerDoubleClicked\n\nLocal Argument\n\nTriggered when a marker is double-clicked on in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerDoubleClicked\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String\n\n#### CuratorMarkerEdited\n\nLocal Argument\n\nTriggered when a marker is moved in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerEdited\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String\n\n#### CuratorMarkerPlaced\n\nLocal Argument\n\nTriggered when new marker is placed in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerPlaced\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String\n\n#### CuratorMarkerSelectionChanged\n\nLocal Argument\n\nTriggered when a marker is selected in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerSelectionChanged\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String\n\n#### CuratorObjectDeleted\n\nLocal Argument\n\nTriggered when an object is deleted in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorObjectDeleted\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object\n\n#### CuratorObjectDoubleClicked\n\nLocal Argument\n\nTriggered when an object is double-clicked on in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorObjectDoubleClicked\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object\n\n#### CuratorObjectEdited\n\nLocal Argument\n\nTriggered when an object is moved or rotated in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorObjectEdited\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object\n\n#### CuratorObjectPlaced\n\nLocal Argument\n\nTriggered when new object is placed in curator interface.\nThis event handler will trigger individually for each unit in a placed group - excluding the crew in vehicles.\n\n```sqf\nthis addEventHandler [\"CuratorObjectPlaced\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object\n\n#### CuratorObjectRegistered\n\nLocal Argument\n\nTriggered when player enters curator interface. Assign curator cost to every object in the game.\nThis is the primary method that a mission designer can use to limit the objects a curator can place.\n\n> [!NOTE]\n> See Curator#Manual Assigning.\n\n```sqf\nthis addEventHandler [\"CuratorObjectRegistered\", {\n    params [\"_curator\", \"_input\"];\n}];\n```\n\n- curator: Object\n- input: Array of Strings - all CfgVehicles classes\n\n#### CuratorObjectSelectionChanged\n\nLocal Argument\n\nTriggered when an object is selected in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorObjectSelectionChanged\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object\n\n#### CuratorPinged\n\nLocal Argument\n\nTriggered when a player pings his curator(s) by pressing the *Zeus* key.\n\n```sqf\nthis addEventHandler [\"CuratorPinged\", {\n    params [\"_curator\", \"_player\"];\n}];\n```\n\n- curator: Object\n- player: Object\n\n#### CuratorSelectionPresetLoaded (Arma 3 v2.14)\n\nLocal Argument\n\nTriggered when a selection preset is loaded using the respective number key or through script.\n\n```sqf\nthis addEventHandler [\"CuratorSelectionPresetLoaded\", {\n    params [\"_curator\", \"_numkey\"];\n}];\n```\n\n- curator: Object\n- numkey: Number\n\n#### CuratorSelectionPresetSaved (Arma 3 v2.14)\n\nLocal Argument\n\nTriggered when a selection preset is saved using the respective CTRL + number key or set through script.\n\n```sqf\nthis addEventHandler [\"CuratorSelectionPresetSaved\", {\n    params [\"_curator\", \"_numkey\"];\n}];\n```\n\n- curator: Object\n- numkey: Number\n\n#### CuratorWaypointDeleted\n\nLocal Argument\n\nTriggered when a waypoint is deleted in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointDeleted\", {\n    params [\"_curator\", \"_waypoint\"];\n}];\n```\n\n- curator: Object\n- waypoint: Array\n\n#### CuratorWaypointDoubleClicked\n\nLocal Argument\n\nTriggered when a waypoint is double-clicked on in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointDoubleClicked\", {\n    params [\"_curator\", \"_waypoint\"];\n}];\n```\n\n- curator: Object\n- waypoint: Array\n\n#### CuratorWaypointEdited\n\nLocal Argument\n\nTriggered when a waypoint is moved in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointEdited\", {\n    params [\"_curator\", \"_group\", \"_waypointID\"];\n}];\n```\n\n- curator: Object\n- group: Group\n- waypointID: Number\n\n#### CuratorWaypointPlaced\n\nLocal Argument\n\nTriggered when new waypoint is placed in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointPlaced\", {\n    params [\"_curator\", \"_group\", \"_waypointID\"];\n}];\n```\n\n- curator: Object\n- group: Group\n- waypointID: Number\n\n#### CuratorWaypointSelectionChanged\n\nLocal Argument\n\nTriggered when a waypoint is selected in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointSelectionChanged\", {\n    params [\"_curator\", \"_waypoint\"];\n}];\n```\n\n- curator: Object\n- waypoint: Array\n\n### UserAction Event Handlers (Arma 3 v2.06)\n\nUserAction Event Handlers are events that trigger on user action.\n\nCommands:\n- addUserActionEventHandler\n- removeUserActionEventHandler\n\n> [!NOTE]\n> See Arma 3: Modded Keybinding.\n\n#### Activate\n\n```sqf\naddUserActionEventHandler [\"KeyName\", \"Activate\", {\n    params [\"_activated\"];\n}];\n```\n\n- activated: Boolean - always returns true\n\n#### Deactivate\n\n```sqf\naddUserActionEventHandler [\"KeyName\", \"Deactivate\", {\n    params [\"_activated\"];\n}];\n```\n\n- activated: Boolean - always returns false\n\n#### Analog\n\n```sqf\naddUserActionEventHandler [\"KeyName\", \"Analog\", {\n    params [\"_value\"];\n}];\n```\n\n- value: Number - input device's analog value\n\n### Projectile Event Handlers (Arma 3 v2.10)\n\nCommands:\n- addEventHandler\n- removeEventHandler\n- removeAllEventHandlers\n\n#### Deleted (Projectile)\n\n```sqf\n_projectile addEventHandler [\"Deleted\", {\n    params [\"_projectile\"];\n}];\n```\n\n- projectile: Object\n\n#### Deflected\n\n```sqf\n_projectile addEventHandler [\"Deflected\", {\n    params [\"_projectile\", \"_position\", \"_velocity\", \"_hitObject\"];\n}];\n```\n\n- projectile: Object\n- position: Array format PositionASL\n- velocity: Array format Vector3D\n- hitObject: Object - the object that deflected the projectile\n\n#### Explode\n\nLocal Argument\n\n```sqf\n_projectile addEventHandler [\"Explode\", {\n    params [\"_projectile\", \"_position\", \"_velocity\"];\n}];\n```\n\n- projectile: Object\n- position: Array format PositionASL\n- velocity: Array format Vector3D\n\n#### HitExplosion\n\n```sqf\n_projectile addEventHandler [\"HitExplosion\", {\n    params [\"_projectile\", \"_hitEntity\", \"_projectileOwner\", \"_hitSelections\", \"_instigator\"];\n}];\n```\n\n- projectile: Object\n- hitEntity: Object\n- projectileOwner: Object\n- hitSelections: Array of Arrays - same list of FireGeometry components that #HitPart (Entity) gets but only contains:\n  - position: Array format PositionASL - position of impact\n  - vector: Array format Vector3D - vector that is orthogonal (perpendicular) to the surface struck. For example, if a wall was hit, vector would be pointing out of the wall at a 90 degree angle\n  - selection: String - named selection of the object that was hit, in the FireGeometry LOD.\n  - radius: Number - radius (size) of component hit\n  - surface: String - surface type struck\n- Arma 3 v2.18 instigator: Object - shot instigator\n\n#### HitPart (Projectile)\n\nTriggered when the projectile hits any surface.\n\n```sqf\n_projectile addEventHandler [\"HitPart\", {\n    params [\"_projectile\", \"_hitEntity\", \"_projectileOwner\", \"_pos\", \"_velocity\", \"_normal\", \"_components\", \"_radius\" ,\"_surfaceType\", \"_instigator\"];\n}];\n```\n\n- projectile: Object\n- hitEntity: Object\n- projectileOwner: Object\n- pos: Array format PositionASL\n- velocity: Array format Vector3D\n- normal: Array format Vector3D\n- components: Array of Strings - the selections that were hit, in the FireGeometry LOD.\n- radius: Number - radius (size) of the hitPoint\n- surfaceType: String\n- Arma 3 v2.18 instigator: Object - shot instigator\n\n> [!IMPORTANT]\n> This event handler only triggers for direct hits and not splash damage, unlike #HitPart (Entity). For splash damage, use #HitExplosion.\n\n#### Init (Projectile)\n\nTriggered whenever a projectile is created. Cannot be used in scripts, only inside class Eventhandlers in config.\n\n```cpp\ninit = \"params ['_projectile'];\";\n```\n\n```sqf\nparams [\"_projectile\"];\n```\n\n- projectile: Object - object the event handler is assigned to\n\n#### MineActivated (Arma 3 v2.14)\n\nLocal Argument\nLocal Effect\n\n```sqf\n_projectile addEventHandler [\"MineActivated\", {\n    params [\"_projectile\", \"_isActive\"];\n}];\n```\n\n- projectile: Object\n- isActive: Boolean - new active state of the mine\n\n#### Penetrated\n\nThis event fires as many times as the projectile penetrates a surface.\n\n```sqf\n_projectile addEventHandler [\"Penetrated\", {\n    params [\"_projectile\", \"_hitObject\", \"_surfaceType\", \"_entryPoint\", \"_exitPoint\", \"_exitVector\"];\n}];\n```\n\n- projectile: Object\n- hitObject: Object\n- surfaceType: String - see surfaceType\n- entryPoint: Array format PositionASL - the projectile's entry point\n- exitPoint: Array format PositionASL - the projectile's exit point\n- exitVector: Array format Vector3D - speed/angle exit vector (see vectorMagnitude to obtain the speed, in metre per second)\n\n#### SubmunitionCreated\n\nThis event fires as many times as submunitions are created.\n\n```sqf\n_projectile addEventHandler [\"SubmunitionCreated\", {\n    params [\"_projectile\", \"_submunitionProjectile\", \"_position\", \"_velocity\"];\n}];\n```\n\n- projectile: Object\n- subMunitionProjectile: Object\n- position: Array format PositionASL\n- velocity: Array format Vector3D\n\n### Group Event Handlers (Arma 3 v2.10)\n\nCommands:\n- addEventHandler\n- removeEventHandler\n- removeAllEventHandlers\n\n#### CombatModeChanged\n\nTriggers when the group's **behaviour** changes (see behaviour, setBehaviour)\n\n```sqf\n_group addEventHandler [\"CombatModeChanged\", {\n    params [\"_group\", \"_newMode\"];\n}];\n```\n\n- group: Group\n- newMode: String - see AI Behaviour (**not** Combat Modes!)\n\n#### CommandChanged\n\n```sqf\n_group addEventHandler [\"CommandChanged\", {\n    params [\"_group\", \"_newCommand\"];\n}];\n```\n\n- group: Group\n- newCommand: String, can be one of:\n\n|  |  |\n|---|---|\n| \"NO CMD\" | NoCommand |\n| \"WAIT\" | Wait |\n| \"ATTACK\" | Attack |\n| \"Suppress\" | Suppress |\n| \"HIDE\" | Hide |\n| \"MOVE\" | Move |\n| \"HOOK CARGO\" | HookCargo |\n| \"UNHOOK CARGO\" | UnhookCargo |\n| \"VIV GETIN\" | ViVGetIn |\n| \"VIV GETOUT\" | ViVGetOut |\n| \"VIV UNLOAD\" | ViVUnload |\n| \"HEAL\" | Heal |\n| \"REPAIR\" | Repair |\n| \"REFUEL\" | Refuel |\n| \"REARM\" | Rearm |\n| \"SUPPORT\" | Support |\n| \"JOIN\" | Join |\n| \"GET IN\" | GetIn |\n| \"FIRE\" | Fire |\n| \"GET OUT\" | GetOut |\n| \"STOP\" | Stop |\n| \"EXPECT\" | Expect |\n| \"ACTION\" | Action |\n| \"SCRIPTED\" | Scripted |\n| \"DISMISS\" | Dismiss |\n| \"HEAL SOLDIER\" | HealSoldier |\n| \"PATCH SOLDIER\" | PatchSoldier |\n| \"FIRST AID\" | FirstAid |\n| \"HEAL SELF\" | HealSoldierSelf |\n| \"ATTACK AND FIRE\" | AttackAndFire |\n| \"CARRY SOLDIER\" | CarrySoldier |\n| \"DROP CARRIED\" | DropCarried |\n| \"TAKE BAG\" | TakeBag |\n| \"ASSEMBLE\" | Assemble |\n| \"DISASSEMBLE\" | DisAssemble |\n| \"DROP BAG\" | DropBag |\n| \"OPEN BAG\" | OpenBag |\n| \"IRLASER ON\" | IRLaserOn |\n| \"IRLASER OFF\" | IRLaserOff |\n| \"GUN LIGHT ON\" | GunLightOn |\n| \"GUN LIGHT OFF\" | GunLightOff |\n| \"FIRE AT POSITION\" | FireAtPosition |\n| \"REPAIR VEHICLE\" | RepairVehicle |\n| \"OPEN PARA\" | OpenParachute |\n| \"KEEP DEPTH LEADER\" | KeepDepthLeader |\n| \"KEEP DEPTH UND SURF\" | KeepDepthUnderSurface |\n| \"KEEP DEPTH ABV SURF\" | KeepDepthAboveSurface |\n| \"KEEP DEPTH BOTTOM\" | KeepDepthBottom |\n| \"PUT IN\" | PutIn |\n| \"UNLOAD FROM\" | UnloadFrom |\n| \"USE CONTAINER MAGAZINE\" | UseContainerMagazine |\n| \"ACTIVATE MINE\" | ActivateMine |\n| \"DISABLE MINE\" | DisableMine |\n\n#### Deleted (Group)\n\n```sqf\n_group addEventHandler [\"Deleted\", {\n    params [\"_group\"];\n}];\n```\n\n- group: Group\n\n#### Empty\n\n```sqf\n_group addEventHandler [\"Empty\", {\n    params [\"_group\"];\n}];\n```\n\n- group: Group\n\n#### EnableAttackChanged\n\n```sqf\n_group addEventHandler [\"EnableAttackChanged\", {\n    params [\"_group\", \"_attackEnabled\"];\n}];\n```\n\n- group: Group\n- attackEnabled: Boolean\n\n#### EnemyDetected\n\n```sqf\n_group addEventHandler [\"EnemyDetected\", {\n    params [\"_group\", \"_newTarget\"];\n}];\n```\n\n- group: Group\n- newTarget: Object\n\n#### Fleeing\n\n```sqf\n_group addEventHandler [\"Fleeing\", {\n    params [\"_group\", \"_fleeingNow\"];\n}];\n```\n\n- group: Group\n- fleeingNow: Boolean\n\n#### FormationChanged\n\n```sqf\n_group addEventHandler [\"FormationChanged\", {\n    params [\"_group\", \"_newFormation\"];\n}];\n```\n\n- group: Group\n- newFormation: String - see setFormation\n\n#### GroupIdChanged\n\n```sqf\n_group addEventHandler [\"GroupIdChanged\", {\n    params [\"_group\", \"_newGroupId\"];\n}];\n```\n\n- group: Group\n- newGroupId: String\n\n#### KnowsAboutChanged\n\n```sqf\n_group addEventHandler [\"KnowsAboutChanged\", {\n    params [\"_group\", \"_targetUnit\", \"_newKnowsAbout\", \"_oldKnowsAbout\"];\n}];\n```\n\n- group: Group\n- targetUnit: Object\n- newKnowsAbout: Number\n- oldKnowsAbout: Number\n\n#### LeaderChanged\n\n```sqf\n_group addEventHandler [\"LeaderChanged\", {\n    params [\"_group\", \"_newLeader\"];\n}];\n```\n\n- group: Group\n- newLeader: Object\n\n#### Local (Group)\n\n```sqf\n_group addEventHandler [\"Local\", {\n    params [\"_group\", \"_isLocal\"];\n}];\n```\n\n- group: Group\n\n#### SpeedModeChanged\n\n```sqf\n_group addEventHandler [\"SpeedModeChanged\", {\n    params [\"_group\", \"_newSpeedMode\"];\n}];\n```\n\n- group: Group\n- newSpeedMode: String - see setSpeedMode\n\n#### UnitJoined\n\n```sqf\n_group addEventHandler [\"UnitJoined\", {\n    params [\"_group\", \"_newUnit\"];\n}];\n```\n\n- group: Group\n- newUnit: Object\n\n#### UnitKilled (Arma 3 v2.18)\n\nLocal Argument\n\nTriggered when a unit in the group is killed.\n\n```sqf\n_group addEventHandler [\"UnitKilled\", {\n    params [\"_group\", \"_unit\", \"_killer\", \"_instigator\", \"_useEffects\"];\n}];\n```\n\n- group: Group - the group the event handler is assigned to\n- unit: Object - the unit that was killed\n- killer: Object - the object that killed the unit. Contains the unit itself in case of collisions.\n- instigator: Object - the person who pulled the trigger\n- useEffects: Boolean - same as *useEffects* in setDamage alt syntax\n\n#### UnitLeft\n\n```sqf\n_group addEventHandler [\"UnitLeft\", {\n    params [\"_group\", \"_oldUnit\"];\n}];\n```\n\n- group: Group\n- oldUnit: Object\n\n#### VehicleAdded\n\n```sqf\n_group addEventHandler [\"VehicleAdded\", {\n    params [\"_group\", \"_newVehicle\"];\n}];\n```\n\n- group: Group\n- newVehicle: Object\n\n#### VehicleRemoved\n\n```sqf\n_group addEventHandler [\"VehicleRemoved\", {\n    params [\"_group\", \"_oldVehicle\"];\n}];\n```\n\n- group: Group\n- oldVehicle: Object\n\n#### WaypointComplete\n\n```sqf\n_group addEventHandler [\"WaypointComplete\", {\n    params [\"_group\", \"_waypointIndex\"];\n}];\n```\n\n- group: Group\n- waypointIndex: Number\n\n### Game UI Event Handlers\n\nIn Game UI Event Handlers trigger when user scrolls or activates in game action menu.\n\nThe following mission EHs are available in Arma 3:\n- PrevAction - action menu scroll up event\n- Action - action menu action event\n- NextAction - action menu scroll down event\n\n> [!IMPORTANT]\n> Only one event of each kind can exist, adding another will overwrite the existing one.\n\nCommands:\n- inGameUISetEventHandler\n\n> [!NOTE]\n> See Arma 3: Event Handlers/inGameUISetEventHandler.\n\n### Control/Display UI Event Handlers\n\nCommands:\n- ctrlAddEventHandler\n- ctrlRemoveEventHandler\n- ctrlRemoveAllEventHandlers\n- displayAddEventHandler\n- displayRemoveEventHandler\n- displayRemoveAllEventHandlers\n\n> [!NOTE]\n> See User Interface Event Handlers.\n\n### Music Event Handlers\n\nMusic event handler, always executed on the computer where it was added.\n\n> [!NOTE]\n> Does not apply to interface-less machines (dedicated server, headless client).\n\nCommands:\n- setMusicEventHandler\n- addMusicEventHandler\n- removeMusicEventHandler\n- removeAllMusicEventHandlers\n\n#### MusicStart (Arma 3 v0.50)\n\nTriggers when CfgMusic sound starts playing, after being executed with playMusic command.\n\n```sqf\naddMusicEventHandler [\"MusicStart\", {\n    params [\"_musicClassname\", \"_eventHandlerID\", \"_currentPosition\", \"_totalLength\"];\n}];\n```\n\n- musicClassName: String - CfgMusic class name of the music that started\n- eventHandlerID: Number - EH id returned by addMusicEventHandler\n- Arma 3 v2.18 currentPosition: Number - current playback position in 0...1 range (see also: getMusicPlayedTime)\n- Arma 3 v2.18 totalLength: Number - track total length in seconds\n\n#### MusicStop (Arma 3 v0.50)\n\nTriggers when CfgMusic sound finished playing, after being executed with playMusic command.\n\nArma 3 v2.14 `playMusic \"\"` triggers this event if a music is currently playing.\n\n```sqf\naddMusicEventHandler [\"MusicStop\", {\n    params [\"_musicClassname\", \"_eventHandlerID\", \"_currentPosition\", \"_totalLength\"];\n}];\n```\n\n- musicClassName: String - CfgMusic class name of the music that stopped\n- eventHandlerID: Number - EH id returned by addMusicEventHandler\n- Arma 3 v2.18 currentPosition: Number - current playback position in 0...1 range (see also: getMusicPlayedTime)\n- Arma 3 v2.18 totalLength: Number - track total length in seconds\n\n### Eden Editor\n\nCommands:\n- add3DENEventHandler\n- remove3DENEventHandler\n- removeAll3DENEventHandlers\n\n> [!NOTE]\n> See also:\n> - Arma 3: Event Handlers: Eden Editor\n> - its sub-category Object Event Handlers\n> - Eden Editor\n\n### Public Variable Broadcast Event\n\nCommands:\n- addPublicVariableEventHandler\n\nTriggers when missionNamespace variable EH is associated with is sent over network via publicVariable, publicVariableServer or publicVariableClient commands.\n\n> [!NOTE]\n> Unlike with other types of EHs, there is no way of removing added public variable event handler\n\n### Weapon Muzzle Config Events\n\nThere are six event handlers that can be set on weapon in config. Their parameters are the same as their entity EH equivalents.\n- \"Fired\" - when muzzle fired - see Fired\n- \"Reload\" - before muzzle is reloaded - see MagazineReloading\n- \"Reloaded\" - after muzzle is reloaded - see Reloaded\n- \"MagazineUnloaded\" - when the magazine is removed - see MagazineUnloaded\n- \"WeaponChanged\" - when the weapon is switched to or from - see WeaponChanged\n- \"SlotItemChanged\" - when one of the weapon's attachments is changed - see SlotItemChanged\n\n```cpp\nclass CfgWeapons\n{\n    class RifleCore;\n    class TAG_Rifle : RifleCore\n    {\n        class EventHandlers\n        {\n            fired        = \"systemChat format ['fired weapon EH output: %1 [time: %2]', _this, time]\";\n            reload        = \"systemChat format ['reload weapon EH output: %1 [time: %2]', _this, time]\";\n            reloaded    = \"systemChat format ['reloaded weapon EH output: %1 [time: %2]', _this, time]\";\n            magazineunloaded    = \"systemChat format ['magazineunloaded weapon EH output: %1 [time: %2]', _this, time]\";\n            slotitemchanged    = \"systemChat format ['slotitemchanged weapon EH output: %1 [time: %2]', _this, time]\";\n            weaponchanged    = \"systemChat format ['weaponchanged weapon EH output: %1 [time: %2]', _this, time]\";\n        };\n    };\n};\n```\n\n### Ammo Config Events\n\nThere are three event handlers that can be set on ammo in config:\n- \"init\" - when the ammo is created, by any mean (fired, created, etc). Params: [shot]\n- \"fired\" - when the ammo is fired (legacy). Params: same as in entity EH \"Fired\".\n- \"ammoHit\" - when the ammo hits anything (can trigger multiple times). Params: [shot, shooter, hitobj, pos, velocity, hitComponents, [hit, indirecthit, indirecthitrange, explosive, name], normal, explode, instigator (since Arma 3 v2.18)]\n\n```cpp\nclass CfgAmmo\n{\n    class BulletCore;\n    class TAG_Bullet : BulletCore\n    {\n        class EventHandlers\n        {\n            init    = \"systemChat format ['init ammo EH output: %1 [time: %2]', _this, time]\";\n            fired    = \"systemChat format ['fired ammo EH output: %1 [time: %2]', _this, time]\";\n            ammoHit    = \"systemChat format ['ammoHit EH output: %1 [time: %2]', _this, time]\";\n        };\n    };\n};\n```\n\n### BI Scripted Events\n\nCommands:\n- BIS_fnc_addScriptedEventHandler\n- BIS_fnc_removeScriptedEventHandler\n- BIS_fnc_removeAllScriptedEventHandlers\n- BIS_fnc_callScriptedEventHandler\n\n> [!NOTE]\n> See also Arma 3: Scripted Event Handlers.\n\nJump to the top of the page","sections":[{"heading":null,"level":1,"markdown":"An Event Handler (abbreviated to EH) allows you to automatically monitor and then execute custom code upon particular events being triggered.\n\nSee also Event Scripts for special event triggered scripts."},{"heading":"Basic Event Handlers","level":3,"markdown":"The object-based Event Handler is always executed on the computer where it was added.\n\nCommands:\n- addEventHandler\n- removeEventHandler\n- removeAllEventHandlers"},{"heading":"AmmoExplodedNear (Arma 3 v2.22)","level":4,"markdown":"Triggers when ammo explodes in some damage range of the object. This EH triggers where the ammo is 'real', similar to HitPart.\n\n```sqf\nthis addEventHandler [\"AmmoExplodedNear\", {\n    params [\"_object\", \"_shot\", \"_position\", \"_velocity\", \"_ammo\", \"_explosive\", \"_indirectHit\", \"_invArmor\", \"_damage\"];\n}];\n```\n\n- object: Object - object the event handler is assigned to\n- shot: Object - shot that has exploded\n- position: Array - world position of the shot\n- velocity: Array - world velocity of the shot\n- ammmo: String - config ammo class name\n- explosive: Number - config value for 'explosive'\n- indirectHit: Number - config value for 'indirectHit'\n- invArmor: Number - calculated inverse armor from config value\n- damage: Number - a rough estimate of the potential damage to the center of the object based on config values and the distance"},{"heading":"AnimChanged","level":4,"markdown":"Global Argument\n\nTriggered every time a new animation is started. This EH is only triggered for the 1st animation state in a sequence.\n\n```sqf\nthis addEventHandler [\"AnimChanged\", {\n    params [\"_unit\", \"_anim\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- anim: String - name of the anim that is started"},{"heading":"AnimDone","level":4,"markdown":"Global Argument\n\nTriggered every time an animation is finished. Triggered for all animation states in a sequence.\n\n```sqf\nthis addEventHandler [\"AnimDone\", {\n    params [\"_unit\", \"_anim\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- anim: String - name of the anim that has been finished"},{"heading":"AnimStateChanged","level":4,"markdown":"Global Argument\n\nTriggered every time an animation state changes. Triggered for all animation states in a sequence.\n\n```sqf\nthis addEventHandler [\"AnimStateChanged\", {\n    params [\"_unit\", \"_anim\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- anim: String - name of the anim that has been started"},{"heading":"Assembled (Arma 3 v2.18)","level":4,"markdown":"Local Argument\n\nTriggers when weapon that is moved out of the world is assembled again. EH should be attached to the entity.\n\n```sqf\nthis addEventHandler [\"Assembled\", {\n    params [\"_entity\", \"_unit\", \"_primaryBag\", \"_secondaryBag\"];\n}];\n```\n\n- entity: Object - weapon this event is assigned to\n- unit: Object - person who assembled the weapon\n- primaryBag: Object - first backpack object which was entity disassembled into (just before it is deleted)\n- secondaryBag: Object - second backpack object which was entity disassembled into (just before it is deleted)"},{"heading":"Attached (Arma 3 v2.18)","level":4,"markdown":"Triggered after an object has been attached to another object (see attachTo).\n\n```sqf\nthis addEventHandler [\"Attached\", {\n    params [\"_attachedObj\", \"_parentObj\", \"_isReattach\", \"_offset\", \"_memoryPointIndex\", \"_followBoneRotation\"];\n}];\n```\n\n- attachedObj: Object\n- parentObj: Object\n- isReattach: Boolean - true if `attachedObj` was already attached to `parentObj`, e.g. if only the offset was changed\n- offset: Array format PositionRelative\n- memoryPointIndex: Number\n- followBoneRotation: Boolean"},{"heading":"CargoLoaded (Arma 3 v2.06)","level":4,"markdown":"Global Argument\n\nTriggered when a vehicle is loaded into another vehicle (ViV).\n\nIt can be added to either the transport vehicle, or the cargo vehicle, and will fire for both cases.\n\n```sqf\nthis addEventHandler [\"CargoLoaded\", {\n    params [\"_parentVehicle\", \"_cargoVehicle\"];\n}];\n```\n\n- parentVehicle: Object - the transport (parent) vehicle\n- cargoVehicle: Object - the cargo (child) vehicle"},{"heading":"CargoUnloaded (Arma 3 v2.06)","level":4,"markdown":"Global Argument\n\nTriggered when a vehicle is unloaded from another vehicle (ViV).\n\nIt can be added to either the transport vehicle, or the cargo vehicle, and will fire for both cases.\n\n```sqf\nthis addEventHandler [\"CargoUnloaded\", {\n    params [\"_parentVehicle\", \"_cargoVehicle\"];\n}];\n```\n\n- parentVehicle: Object - the transport (parent) vehicle\n- cargoVehicle: Object - the cargo (child) vehicle"},{"heading":"ContainerClosed (Arma 3 v1.32)","level":4,"markdown":"Global Argument\n\nTriggers when player finished accessing cargo container.\nThis event handler is similar to InventoryClosed EH, but needs to be assigned to the container rather than the player.\n\n**Note:** will trigger only for the unit opening container.\n\n```sqf\nthis addEventHandler [\"ContainerClosed\", {\n    params [\"_container\", \"_unit\"];\n}];\n```\n\n- container: Object - cargo container.\n- unit: Object - unit who accessed the container"},{"heading":"ContainerOpened (Arma 3 v1.32)","level":4,"markdown":"Global Argument\n\nTriggers when cargo container is accessed by player.\nThis event handler is similar to InventoryOpened EH, but needs to be assigned to the container rather than the player and cannot be overridden.\n\n**Note:** will trigger only for the unit opening container.\n\n```sqf\nthis addEventHandler [\"ContainerOpened\", {\n    params [\"_container\", \"_unit\"];\n}];\n```\n\n- container: Object - cargo container\n- unit: Object - unit who accessed the container"},{"heading":"ControlsShifted (Arma 3 v1.00)","level":4,"markdown":"Global ArgumentLocal Effect\n\nTriggers when control of a vehicle is shifted (pilot->co-pilot, co-pilot->pilot), usually when user performs an action such as TakeVehicleControl, SuspendVehicleControl, UnlockVehicleControl, LockVehicleControl, or when enableCopilot command is used. This event handler will always fire on the PC where action is triggered as well as where the vehicle is local at the time. When control of the vehicle is shifted, the locality of the vehicle changes to the locality of the new controller. For example, if helicopter is local to the server and co-pilot takes controls, the helicopter changes locality to co-pilot PC.\nThis means that if \"ControlsShifted\" EH was added on both server and client, \"Take Controls\" action will trigger EH on both, client and server PC, but subsequent co-pilot \"Release Controls\" action will trigger only on co-pilot's PC, because vehicle will be local to co-pilot at this point. There is also a slightly better mission version of ControlsShifted event handler.\n\n```sqf\nthis addEventHandler [\"ControlsShifted\", {\n    params [\"_vehicle\", \"_activeCoPilot\", \"_oldController\"];\n}];\n```\n\n- vehicle: Object - vehicle which controls were shifted\n- activeCoPilot: Object - co-pilot unit which controls vehicle after this event. objNull if co-pilot is not controlling the vehicle\n- oldController: Object - unit who controlled vehicle before this event"},{"heading":"Dammaged","level":4,"markdown":"Global Argument\n\nTriggered when the unit is damaged. In ArmA works with all vehicles not only men like in OFP.\n\n**Notes:**\n- The typo is \"intentional\": it is Da**mm**aged with two \"m\".\n- If simultaneous damage occured (e.g. via grenade) EH might be triggered several times.\n- The Dammaged EH will not necessarily fire if only minor damage occurred (e.g. firing a bullet at a tank), even though the damage increased.\n\n```sqf\nthis addEventHandler [\"Dammaged\", {\n    params [\"_unit\", \"_hitSelection\", \"_damage\", \"_hitPartIndex\", \"_hitPoint\", \"_shooter\", \"_projectile\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- hitSelection: String - name of the selection where the unit was damaged\n- damage: Number - resulting level of damage\n- Arma 3 v1.68 hitPartIndex: Number - hit index of the hit selection\n- Arma 3 v1.68 hitPoint: String - hit point Cfg name\n- Arma 3 v1.70 shooter: Object - shooter reference (to get instigator use getShotParents on projectile)\n- Arma 3 v1.70 projectile: Object - the projectile that caused damage"},{"heading":"Deleted (Entity) (Arma 3 v1.68)","level":4,"markdown":"Global Argument\n\nTriggered just before the assigned entity is deleted.\n\n```sqf\nthis addEventHandler [\"Deleted\", {\n    params [\"_entity\"];\n}];\n```\n\n- entity: Object - object the event handler is assigned to"},{"heading":"Detached (Arma 3 v2.18)","level":4,"markdown":"Triggered after an object has been detached from its parent object (see detach). Does not fire if the parent object was deleted.\n\n```sqf\nthis addEventHandler [\"Detached\", {\n    params [\"_attachedObj\", \"_parentObj\"];\n}];\n```\n\n- attachedObj: Object\n- parentObj: Object"},{"heading":"Disassembled (Arma 3 v2.00)","level":4,"markdown":"Local Argument\n\nTriggers when entity such as weapon/backpack gets disassembled. EH should be attached to the entity.\n\n```sqf\nthis addEventHandler [\"Disassembled\", {\n    params [\"_entity\", \"_primaryBag\", \"_secondaryBag\", \"_unit\"];\n}];\n```\n\n- entity: Object - weapon this event is assigned to (just before is is moved out of the world)\n- primaryBag: Object - first backpack object which was entity disassembled into\n- secondaryBag: Object - second backpack object which was entity disassembled into\n- Arma 3 v2.18 unit: Object - person who disassembled the weapon"},{"heading":"Engine","level":4,"markdown":"Global Argument\n\nTriggered when the engine of the unit is turned on/off.\n\n> [!NOTE]\n> Although the event is global, on clients (non-server) and applied to remote vehicles, it will fire only if the vehicle is closer than about 6 km from the camera.\n> Should the vehicle be far away, it will fire as soon as the camera and vehicle are close enough together, alongside the isEngineOn flag change.\n\n```sqf\nthis addEventHandler [\"Engine\", {\n    params [\"_vehicle\", \"_engineState\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- engineState: Boolean - true when the engine is turned on, false when turned off"},{"heading":"EpeContact (Arma 3 v1.00)","level":4,"markdown":"Global Argument\n\nTriggered when object collision (PhysX) is in progress.\n\n```sqf\nthis addEventHandler [\"EpeContact\", {\n    params [\"_object1\", \"_object2\", \"_selection1\", \"_selection2\", \"_force\", \"_reactVect\", \"_worldPos\"];\n}];\n```\n\n- object1: Object - object with attached handler\n- object2: Object - object which is colliding with object1\n- selection1: String - selection of object1 which is colliding - not in use at this moment, empty string is always returned\n- selection2: String - selection of object2 which is colliding - not in use at this moment, empty string is always returned\n- force: Number - force of collision\n- Arma 3 v2.12 reactVect: Array - impact reaction force vector\n- Arma 3 v2.12 worldPos: PositionWorld - point of impact in world coordinates"},{"heading":"EpeContactEnd (Arma 3 v1.00)","level":4,"markdown":"Global Argument\n\nTriggered when object collision (PhysX) ends.\n\n```sqf\nthis addEventHandler [\"EpeContactEnd\", {\n    params [\"_object1\", \"_object2\", \"_selection1\", \"_selection2\", \"_force\"];\n}];\n```\n\n- object1: Object - object with attached handler\n- object2: Object - object which is colliding with object1\n- selection1: String - selection of object1 which is colliding - not in use at this moment, empty string is always returned\n- selection2: String - selection of object2 which is colliding - not in use at this moment, empty string is always returned\n- force: Number - force of collision"},{"heading":"EpeContactStart (Arma 3 v1.00)","level":4,"markdown":"Global Argument\n\nTriggered when object collision (PhysX) starts.\n\n```sqf\nthis addEventHandler [\"EpeContactStart\", {\n    params [\"_object1\", \"_object2\", \"_selection1\", \"_selection2\", \"_force\", \"_reactForce\", \"_worldPos\"];\n}];\n```\n\n- object1: Object - object with attached handler\n- object2: Object - object which is colliding with object1\n- select1: String - selection of object1 which is colliding - not in use at this moment, empty string is always returned\n- select2: String - selection of object2 which is colliding - not in use at this moment, empty string is always returned\n- force: Number - force of collision\n- Arma 3 v2.12 reactForce: Array - impact reaction force vector\n- Arma 3 v2.12 worldPos: PositionWorld - point of impact in world coordinates"},{"heading":"Explosion (Arma 3 v0.76)","level":4,"markdown":"Global Argument\n\nTriggered when a vehicle or unit is damaged by a nearby explosion.\nIt can be assigned to a remote unit or vehicle but will only fire on the PC where EH is added and explosion is local, i.e. it really needs to be added on every PC and JIP and will fire only where the explosion is originated.\n\n```sqf\nthis addEventHandler [\"Explosion\", {\n    params [\"_vehicle\", \"_damage\", \"_explosionSource\"];\n}];\n```\n\n- vehicle: Object - object the event handler is assigned to\n- damage: Number - damage inflicted to the object\n- Arma 3 v2.10 explosionSource: Object - the exploding object (NOT the shooter) - may be objNull in some cases\n\n> [!NOTE]\n> This event will fire even for tiniest of explosion damage (which appears as 0 damage argument), while #HitPart (Entity) could ignore such damage and not fire.\n> Example of such event would be a tank firing AP round and hitting ground a meter away from the vehicle, it does not produce an explosion yet its indirectHit could still cause tiny amount of damage to weak hit points (car wheels, headlights, etc.).\n> In such case you might not get any #HitPart (Entity) event fires, get some #HandleDamage events if target is local, and get this Explosion event."},{"heading":"Fired","level":4,"markdown":"Global Argument\n\nTriggered when the unit fires a weapon.\n\nThis EH will not trigger if a unit fires out of a vehicle. For those cases an EH has to be attached to that particular vehicle.\nWhen \"Manual Fire\" is used, the *gunner* is objNull if gunner is not present or the *gunner* is not the one who fires.\nTo check if \"Manual Fire\" is on, use isManualFire. The actual shot instigator could be retrieved with getShotParents command.\n\n> [!WARNING]\n> **Special multiplayer behaviour:** When added to a remote unit or vehicle, this EH will only fire if said entity is within range of the camera.\n> That range is determined by the fired ammo's highest visibleFire and audibleFire config value.\n> In case of units, muzzle attachment coefficients are applied too.\n\n```sqf\nthis addEventHandler [\"Fired\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_mode\", \"_ammo\", \"_magazine\", \"_projectile\", \"_gunner\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- weapon: String - fired weapon\n- muzzle: String - muzzle that was used\n- mode: String - current mode of the fired weapon\n- ammo: String - ammo used\n- magazine: String - magazine name which was used\n- projectile: Object - object of the projectile that was shot out\n- Arma 3 v1.66 gunner: Object - gunner whose weapons are firing."},{"heading":"FiredMan (Arma 3 v1.66)","level":4,"markdown":"Global Argument\n\nTriggered when the unit fires a weapon. This EH must be attached to a soldier and unlike with \"Fired\" EH, it will fire regardless of whether the soldier is on foot or firing vehicle weapon.\nFor remoteControled unit use \"Fired\" EH instead.\n\n> [!WARNING]\n> **Special multiplayer behaviour:** When added to a remote unit or vehicle, this EH will only fire if said entity is within range of the camera.\n> That range is determined by the fired ammo's highest visibleFire and audibleFire config value.\n> In case of units, muzzle attachment coefficients are applied too.\n\n```sqf\nthis addEventHandler [\"FiredMan\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_mode\", \"_ammo\", \"_magazine\", \"_projectile\", \"_vehicle\"];\n}];\n```\n\n- unit: Object - unit the event handler is assigned to (the instigator)\n- weapon: String - fired weapon\n- muzzle: String - muzzle that was used\n- mode: String - current mode of the fired weapon\n- ammo: String - ammo used\n- magazine: String - magazine name which was used\n- projectile: Object - object of the projectile that was shot out\n- vehicle: Object - vehicle, if weapon is vehicle weapon, otherwise objNull"},{"heading":"FiredNear","level":4,"markdown":"Global Argument\n\nTriggered when a weapon is fired somewhere *near* the unit or vehicle. It is also triggered if the unit itself is firing.\n\nWhen \"Manual Fire\" is used, the *gunner* is objNull if gunner is not present or the *gunner* is not the one who fires.\nTo check if \"Manual Fire\" is on, use isManualFire. The actual shot instigator can be retrieved with getShotParents command.\n\nArma 3 v1.30 Works with thrown weapons (using the \"Throw\" weapon) like grenades.\n\n```sqf\nthis addEventHandler [\"FiredNear\", {\n    params [\"_unit\", \"_firer\", \"_distance\", \"_weapon\", \"_muzzle\", \"_mode\", \"_ammo\", \"_gunner\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- firer: Object - object which fires a weapon near the unit\n- distance: Number - distance in meters between the *unit* and *firer* (max. distance ~69m)\n- weapon: String - fired weapon\n- muzzle: String - muzzle that was used\n- mode: String - current mode of the fired weapon\n- ammo: String - ammo used\n- Arma 3 v1.66 gunner: Object - gunner, whose weapons are fired"},{"heading":"Fuel","level":4,"markdown":"Global Argument\n\nTriggered when the vehicle's fuel status changes between non-empty and empty or between empty and non-empty.\n\n```sqf\nthis addEventHandler [\"Fuel\", {\n    params [\"_vehicle\", \"_hasFuel\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- hasFuel: Boolean - false when has no fuel, true when has some fuel"},{"heading":"Gear","level":4,"markdown":"Global Argument\n\nTriggered when the unit lowers/retracts the landing gear, whether it is a helicopter or a plane.\nAlso triggered for helicopters in landing mode, regardless if they have retractable gear or not.\n\n> [!NOTE]\n> Not to be confused with *InventoryOpened* and *InventoryClosed* events, *Gear* fires when the landing gear state on an aircraft has changed.\n\n```sqf\nthis addEventHandler [\"Gear\", {\n    params [\"_vehicle\", \"_gearState\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- gearState: Boolean - true when the gear is lowered, false when retracted"},{"heading":"GestureChanged (Arma 3 v2.06)","level":4,"markdown":"Global Argument\n\nTriggered every time a new gesture is played.\n\n```sqf\nthis addEventHandler [\"GestureChanged\", {\n    params [\"_unit\", \"_gesture\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- gesture: String - name of the gesture that has started playing"},{"heading":"GestureDone (Arma 3 v2.06)","level":4,"markdown":"Global Argument\n\nTriggered every time a gesture is finished.\n\n```sqf\nthis addEventHandler [\"GestureDone\", {\n    params [\"_unit\", \"_gesture\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- gesture: String - name of the gesture that has been finished"},{"heading":"GetIn","level":4,"markdown":"Global Argument\n\nTriggers when a unit enters the vehicle to which this EH has been added. This EH is triggered by moveInXXXX commands and \"GetInXXXX\" actions, but not upon a seat change within the same vehicle.\n\nIn vehicles with multi-turret setup, entering any turret will show \"gunner\" for position.\n\n```sqf\nthis addEventHandler [\"GetIn\", {\n    params [\"_vehicle\", \"_role\", \"_unit\", \"_turret\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- role: String - can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n- unit: Object - unit that entered the vehicle\n- Arma 3 v1.36 turret: Array - turret path"},{"heading":"GetInMan (Arma 3 v1.58)","level":4,"markdown":"Global Argument\n\nTriggers when a unit enters a vehicle. Similar to \"GetIn\" but must be assigned to a unit and not vehicle.\nPersistent on respawn if assigned where unit was local. This EH is triggered by moveInXXXX commands and \"GetInXXXX\" actions.\n\n```sqf\nthis addEventHandler [\"GetInMan\", {\n    params [\"_unit\", \"_role\", \"_vehicle\", \"_turret\"];\n}];\n```\n\n- unit: Object - unit the event handler is assigned to\n- role: String - can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n- vehicle: Object - vehicle the unit entered\n- turret: Array - turret path"},{"heading":"GetOut","level":4,"markdown":"Global Argument\n\nTriggers when a unit gets out from the vehicle to which this EH has been added.\nThis EH is triggered by moveOut, \"GetOut\" & \"Eject\" actions, if an alive crew member disconnects or is deleted, but not upon a seat change within the same vehicle.\n\n```sqf\nthis addEventHandler [\"GetOut\", {\n    params [\"_vehicle\", \"_role\", \"_unit\", \"_turret\", \"_isEject\"];\n}];\n```\n\n- vehicle: Object - vehicle the event handler is assigned to\n- role: String - can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n- unit: Object - unit that left the vehicle\n- Arma 3 v1.36 turret: Array - turret path\n- Arma 3 v2.14 isEject: Boolean - true if unit used 'Eject' action"},{"heading":"GetOutMan (Arma 3 v1.58)","level":4,"markdown":"Global Argument\n\nTriggers when a unit exits a vehicle. Similar to \"GetOut\" but must be assigned to a unit and not vehicle.\nPersistent on respawn if assigned where unit was local. This EH is triggered by moveOut and \"GetOut\" & \"Eject\" actions.\n\n```sqf\nthis addEventHandler [\"GetOutMan\", {\n    params [\"_unit\", \"_role\", \"_vehicle\", \"_turret\", \"_isEject\"];\n}];\n```\n\n- unit: Object - unit the event handler is assigned to\n- role: String - can be either \"driver\", \"gunner\", \"commander\" or \"cargo\"\n- vehicle: Object - vehicle that the unit left\n- turret: Array - turret path\n- Arma 3 v2.14 isEject: Boolean - true if unit used 'Eject' action"},{"heading":"HandleDamage","level":4,"markdown":"Global Argument\n\nTriggers when the unit is damaged and fires for each damaged selection separately\nWorks with all vehicles.\nThis EH can accept a remote unit as argument however it will only fire when the unit is local to the PC this event handler was added on.\nFor example, you can add this event handler to one particular vehicle on every PC.\nWhen this vehicle gets hit, only EH on PC where the vehicle is currently local will fire.\n\nIf the provided code returns a numeric value, this value will overwrite the default damage of given selection after processing.\nIf no value is returned, the default damage processing will be done - this allows for safe stacking of this event handler.\nOnly the return value of the last added \"HandleDamage\" EH is considered.\n\n> [!IMPORTANT]\n> A return value of 0 will make the unit **invulnerable** if damage is not scripted in other ways (i.e using setDamage and/or setHit for additional damage handling).\n> The return value is the hit zone's **absolute damage value**, **not** the damage to be *added* to it.\n\n**Notes:**\n- Multiple \"HandleDamage\" EHs can be added to the same unit. If multiple EHs return damage value for custom damage handling, only last returned value will be considered by the engine.\nEHs that do not return value can be safely added after EHs that do return value.\n- You can save the last event as timestamp (diag_tickTime) onto the unit, as well as the current health of the unit/its selections, with setVariable and query it on each \"HandleDamage\" event with getVariable to define a system how to handle the \"HandleDamage\" event.\n- \"HandleDamage\" will continue to trigger even if the unit is already dead.\n- \"HandleDamage\" is persistent. If you add it to the player object, it will continue to exist after player respawned.\n- \"HandleDamage\" can trigger \"twice\" per damage event. Once for direct damage, once for indirect damage (explosive damage). This can happen even in the same frame, but is unlikely.\n- Use setMissionOptions to filter out no damage calls or fake head hit.\n\nAdditional [Celery's explanation (Updated by ShadowRanger for Arma 3)](https://forums.bistudio.com/forums/topic/205515-handledamage-event-handler-explained/).\n\n```sqf\nthis addEventHandler [\"HandleDamage\", {\n    params [\"_unit\", \"_selection\", \"_damage\", \"_source\", \"_projectile\", \"_hitPartIndex\", \"_instigator\", \"_hitPoint\", \"_directHit\", \"_context\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- selection: String - name of the selection where the unit was damaged.\n  - \"\" for overall structural damage\n  - \"?\" for unknown selections\n- damage: Number - resulting level of damage for the selection\n- source: Object - the source unit that caused the damage\n- projectile: String - classname of the projectile that caused inflicted the damage. (\"\" for unknown, such as fall damage)\n- Arma 3 v1.50 hitPartIndex: Number - hit part index of the hit point, -1 otherwise\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger\n- Arma 3 v1.68 hitPoint: String - hit point Cfg name\n- Arma 3 v2.12 directHit: Boolean - true for direct projectile damage, false for explosion splash damage and all other kinds of damage like fall damage, fire damage, collision damage, etc.\n- Arma 3 v2.16 context: Number - some additional context for the event:\n\n0 : TotalDamage - total damage adjusted before iteration through hitpoints\n\n1 : HitPoint - some hit point processed during iteration\n\n2 : LastHitPoint - the last hitpoint from iteration is processed\n\n3 : FakeHeadHit - head hit that is added/adjusted\n\n4 : TotalDamageBeforeBleeding - total damage is adjusted before calculating bleeding\n\n> [!NOTE]\n> Between an unknown version (confirmed in Arma 3 v1.70) until v1.78 HandleDamage event triggered for every selection of a vehicle, no matter if the section was damaged or not."},{"heading":"HandleHeal","level":4,"markdown":"Global Argument\n\nTriggered when unit starts healing process (player using heal action on self or other unit, scripted action or AI heals after being ordered or on its own).\nThis event handler must be added to the 'injured' (could be added to Init field in editor) and in multiplayer will trigger only on PC where 'healer' is local. If code returns anything but true, engine side healing follows, otherwise healing is aborted.\n\n> [!IMPORTANT]\n> When AI unit is ordered (or acts at own accord) to heal at a medical vehicle and the event handler returns true, the healing is canceled but AI will try again and again and again. The event handler in this case will fire every second until AI unit is healed by other means.\n\n**NOTE**: This Event Handler was broken before Arma 3 v2.18.\n\n```sqf\nthis addEventHandler [\"HandleHeal\", {\n    _this spawn {\n        params [\"_injured\", \"_healer\", \"_isMedic\", \"_atVehicle\", \"_action\"];\n        private _damage = damage _injured;\n        if (_injured == _healer) then\n        {\n            waitUntil { damage _injured != _damage };\n            if (damage _injured < _damage) then\n            {\n                _injured setDamage 0;\n            };\n        };\n    };\n}];\n```\n\n```sqf\nthis addEventHandler [\"HandleHeal\", {\n    params [\"_injured\", \"_healer\", \"_isMedic\", \"_atVehicle\", \"_action\"];\n}];\n```\n\n- injured: Object - unit EH is attached to\n- healer: Object - unit that does the healing (could be the same unit as 'injured')\n- isMedic: Boolean - true when healer is 'Medic'\n- Arma 3 v2.18 atVehicle: Object - when healing at medical vehicle, this is the vehicle\n- Arma 3 v2.18 action: String - the action that triggered the event handler, for example \"SoldierHealSelf\""},{"heading":"HandleIdentity","level":4,"markdown":"Global Argument\n\nTriggered whenever an entity is created. Can be used in scripts if EH is added immediately after unit is created in unscheduled environment.\nDoesn't trigger for editor placed units. Does not work in Multiplayer. If EH scope returns true, the default engine identity application is overridden.\n\n```sqf\nbob = group player createUnit [typeOf player, position player, [], 0, \"NONE\"];\nbob addEventHandler [\"HandleIdentity\", {\n    params [\"_unit\"];\n    hint str _unit;\n}];\n```\n\n- unit: Object - object the event handler is assigned to"},{"heading":"HandleRating (Arma 3 v1.32)","level":4,"markdown":"Local Argument\n\nTriggered when engine adds rating to overall rating of the unit, usually after a kill or a friendly kill.\nIf EH code returns Number, this will override default engine behaviour and the resulting value added will be the one returned by EH code.\n\n```sqf\nthis addEventHandler [\"HandleRating\", {\n    params [\"_unit\", \"_rating\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- rating: Number - rating to be added"},{"heading":"HandleScore (Arma 3 v1.32)","level":4,"markdown":"Global ArgumentServer Execution\n\nTriggered when engine adds score to overall score of the unit, usually after a kill.\nIf the EH code returns Nothing or true, the default engine scoreboard update (score, vehicle kills, infantry kills, etc) is applied, if it returns false, the engine update is cancelled. To add or modify score, use addScore and addScoreSide commands.\nFor remote units like players, the event does not persist after respawn, and must be re-added to the new unit.\n\n**Note:** MP only.\n\n```sqf\nthis addEventHandler [\"HandleScore\", {\n    params [\"_unit\", \"_object\", \"_score\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- object: Object - object for which score was awarded\n- score: Number - score to be added"},{"heading":"Hit","level":4,"markdown":"Local Argument\n\nTriggered when the unit is hit/damaged.\n\nIs *not* always triggered when unit is killed by a hit.\n\nMost of the time only the killed event handler is triggered when a unit dies from a hit.\n\nThe hit EH will not necessarily fire if only minor damage occurred (e.g. firing a bullet at a tank), even though the damage increased.\n\nDoes not fire when a unit is set to allowDamage false.\n\n```sqf\nthis addEventHandler [\"Hit\", {\n    params [\"_unit\", \"_source\", \"_damage\", \"_instigator\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- source: Object - object that caused the damage – contains *unit* in case of collisions\n- damage: Number - level of damage caused by the hit\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger"},{"heading":"HitPart (Entity)","level":4,"markdown":"Global Argument\n\nTriggered when the object it was added to gets damaged.\nIt returns the position and component that was hit on the object within a nested array, this is because the model may have more than one selection name for the hit component (i.e. a single piece of geometry can be simultaneously part of multiple, overlapping named selections).\n\nWhile you can add \"HitPart\" handler to a remote unit, the respective addEventHandler command must be executed on the shooter's PC and will only fire on shooter's PC as well.\nThe event will not fire if the shooter is not local, even if the target itself is local.\nAdditionally, if the unit gets damaged by any means other than ammunition or explosions, such as fall damage and burning, \"HitPart\" will not fire.\nBecause of this, this event handler is most suitable for when the shooter needs feedback on his shooting, such as target practicing or hitmarker creation.\n\nThis EH returns an array of arrays. Each sub-array contains data for the part that was hit as usually multiple parts are hit at the same time (see HitPart Sample). The structure of the sub-arrays is listed below.\n\n```sqf\nthis addEventHandler [\"HitPart\", {\n    {\n        _x params [\n            \"_target\", \"_shooter\", \"_projectile\", \"_position\", \"_velocity\",\n            \"_selection\", \"_ammo\", \"_vector\", \"_radius\", \"_surfaceType\",\n            \"_isDirect\", \"_instigator\"\n        ];\n    } forEach _this;\n}];\n```\n\n- target: Object - object that was damaged\n- shooter: Object - Unit or vehicle that inflicted the damage. If injured by a vehicle collision, the target itself is returned, or objNull in case of explosions. In case of explosives that were planted by someone (e.g. satchel charges), that unit is returned.\n- projectile: Object - object that was fired\n- position: Array format PositionASL - position the bullet impacted\n- velocity: Vector3D - 3D speed at which the bullet impacted\n- selection: Array - array of Strings with named selection of the object that were hit, in the FireGeometry LOD\n- ammo:\n  - Array in format [hitValue, indirectHitValue, indirectHitRange, explosiveDamage, ammoClassName] - If the damage was directly or indirectly inflicted by a projectile. Hit and damage values are derived from the projectile's CfgAmmo class, and do not match the actual damage inflicted, which is usually lower due to armor and other factors.\n  - Array in format [impulseValue, 0, 0, 0] - if the damage was inflicted by a vehicle collision\n- vector: Vector3D - Vector that is orthogonal (perpendicular) to the surface struck. For example, if a wall was hit, the vector would be pointing out of the wall at a 90 degree angle.\n- radius: Number - radius (size) of component hit\n- surfaceType: String - surface type struck\n- isDirect: Boolean - true if object was directly hit, false if it was hit by indirect / splash damage\n- Arma 3 v2.18 instigator: Object - shot instigator\n\n> [!NOTE]\n> See #HitPart (Projectile) for a similar event handler that is attached to the projectile instead of the entity.\n\n> [!NOTE]\n> This event does not fire when miniscule explosive damage is dealt to the target entity, but the Explosion event will still fire."},{"heading":"IncomingMissile","level":4,"markdown":"Global Argument\n\nTriggered when a unit fires a missile or rocket at the target. For projectiles fired by players this EH only triggers for guided missiles that have locked onto the target.\n\n```sqf\nthis addEventHandler [\"IncomingMissile\", {\n    params [\"_target\", \"_ammo\", \"_vehicle\", \"_instigator\", \"_missile\"];\n}];\n```\n\n- target: Object - object the event handler is assigned to\n- ammo: String - ammo type that was fired on the target\n- Arma 3 v1.42 vehicle: Object - vehicle that fired the weapon. In case of soldier, unit is returned\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger\n- Arma 3 v2.10 missile: Object - the incoming missile"},{"heading":"Init (Entity)","level":4,"markdown":"Global Argument\n\nTriggered whenever an entity is created. Cannot be used in scripts, only inside class Eventhandlers in config.\n\n> [!IMPORTANT]\n> It is recommended to use the #PostInit event handler instead of this one when setting entity textures (setObjectTexture, BIS_fnc_initVehicle etc) to avoid networking issues.\n\ne.g:\n\n```cpp\ninit = \"params ['_entity'];\";\n```\n\n```sqf\nparams [\"_entity\"];\n```\n\n- entity: Object - object the event handler is assigned to"},{"heading":"InventoryClosed (Arma 3 v1.22)","level":4,"markdown":"Global Argument\n\nTriggered when the unit closes inventory. Said unit can be non-local when adding the EH, but **must** be local for the EH to trigger.\n\n```sqf\nthis addEventHandler [\"InventoryClosed\", {\n    params [\"_unit\", \"_container\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- container: Object - connected container or weaponholder\n\n```sqf\n// Delete dropped items when inventory closed\nplayer addEventHandler [\"InventoryClosed\", {\n    params [\"_unit\", \"_container\"];\n    if (_container isKindOf \"WeaponHolder\") then\n    {\n        deleteVehicle _container;\n    };\n}];\n```"},{"heading":"InventoryOpened (Arma 3 v1.22)","level":4,"markdown":"Global Argument\n\nTriggered when unit opens inventory. Said unit can be non-local when adding the EH, but **must** be local for the EH to trigger. End EH main scope with true to override the opening of the inventory in case you wish to handle it yourself:\n\n```sqf\n// Create and open an ammo box when \"Inventory\" button is pressed\nplayer addEventHandler [\"InventoryOpened\", {\n    player removeAllEventHandlers \"InventoryOpened\";\n    _box = \"Box_NATO_Ammo_F\" createVehicle [0,0,0];\n    _box setPosASL (player modelToWorldVisualWorld [0,1.5,0.5]);\n    player action [\"Gear\", _box];\n    true; // <-- inventory override\n}];\n```\n\nTo return all nearby containers use nearSupplies command.\n\n```sqf\nthis addEventHandler [\"InventoryOpened\", {\n    params [\"_unit\", \"_primaryContainer\", \"_secondaryContainer\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- primaryContainer: Object - connected container or weaponholder\n- Arma 3 v1.66 secondaryContainer: Object - second connected container or weaponholder or objNull"},{"heading":"Killed","level":4,"markdown":"Local Argument\n\nTriggered when the unit is killed.\n\n```sqf\nthis addEventHandler [\"Killed\", {\n    params [\"_unit\", \"_killer\", \"_instigator\", \"_useEffects\", \"_shot\", \"_real\"];\n}];\n```\n\n- unit: Object - the object the event handler is assigned to\n- killer: Object - the object that killed the unit. Contains the unit itself in case of collisions.\n- Arma 3 v1.66 instigator: Object - the person who pulled the trigger\n- Arma 3 v1.68 useEffects: Boolean - same as *useEffects* in setDamage alt syntax\n- Arma 3 v2.22 shot: Object - shot that caused damage\n- Arma 3 v2.22 real: Boolean - true when the shot was 'real' where the event handler triggered"},{"heading":"LandedStopped","level":4,"markdown":"Global Argument\n\nTriggered when an AI pilot would get out usually. Not executed for player.\n\n```sqf\nthis addEventHandler [\"LandedStopped\", {\n    params [\"_plane\", \"_airportID\", \"_airportObject\"];\n}];\n```\n\n- plane: Object - object the event handler is assigned to\n- airportID: Number - ID of the airport (-1 for anything else)\n- Arma 3 v2.12 airportObject: Object - airport object in the event of a Dynamic Airport, otherwise objNull"},{"heading":"LandedTouchDown","level":4,"markdown":"Global Argument\n\nTriggered when a plane (AI or player) touches the ground.\n\n```sqf\nthis addEventHandler [\"LandedTouchDown\", {\n    params [\"_plane\", \"_airportID\", \"_airportObject\"];\n}];\n```\n\n- plane: Object - object the event handler is assigned to\n- airportID: Number - ID of the airport (-1 for anything else)\n- Arma 3 v2.12 airportObject: Object - airport object in the event of a Dynamic Airport, otherwise objNull"},{"heading":"Landing (Arma 3 v1.70)","level":4,"markdown":"Global Argument\n\nTriggered when an AI pilot (or auto-pilot) is preparing for landing. The exact moment of triggering coincides with lowering of the gear (\"Gear\" EH)\n\n```sqf\nthis addEventHandler [\"Landing\", {\n    params [\"_plane\", \"_airportID\", \"_isCarrier\"];\n}];\n```\n\n- plane: Object - object the event handler is assigned to\n- airportID: Number or Object - ID of the airport or aircraft carrier object\n- isCarrier: Boolean - true if landing on aircraft carrier"},{"heading":"LandingCanceled (Arma 3 v1.70)","level":4,"markdown":"Global Argument\n\nTriggered when AI pilot landing is cancelled (for example new order received to land elsewhere).\nThe exact moment of triggering coincides with retracting of the gear (\"Gear\" EH).\n\n**Note**: Does not trigger if player switches off auto-pilot. Canceled is spelled with one `L`\n\n```sqf\nthis addEventHandler [\"LandingCanceled\", {\n    params [\"_plane\", \"_airportID\", \"_isCarrier\"];\n}];\n```\n\n- plane: Object - object the event handler is assigned to\n- airportID: Number or Object - ID of the airport or aircraft carrier object (-1 no airport)\n- isCarrier: Boolean - true if landing on aircraft carrier"},{"heading":"LaserTargetChanged (Arma 3 v2.22)","level":4,"markdown":"Triggered when the laser target changes.\n\n```sqf\nthis addEventHandler [\"LaserTargetChanged\", {\n    params [\"_unit\", \"_laserTarget\", \"_designatedTarget\", \"_turretPath\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- laserTarget: Object - the laser target entity that got created at impact point\n- designatedTarget: Object - the object that is targeted by the laser\n- turretPath: Turret Path - the path to the turret that activated the laser. It is empty when the event is triggered by a unit"},{"heading":"LeaningChanged (Arma 3 v2.18)","level":4,"markdown":"Global Argument\n\nTriggered when a soldier leaning factor is changed between -1 (extreme left), 0 (not leaning) and 1 (extreme right)\n\n```sqf\nthis addEventHandler [\"LeaningChanged\", {\n    params [\"_unit\", \"_newLeaning\", \"_oldLeaning\"];\n}];\n```\n\n- unit: Object - soldier\n- newLeaning: Number from -1 to 1\n- oldLeaning: Number from -1 to 1"},{"heading":"Local (Entity)","level":4,"markdown":"Global Argument\n\nTriggers when locality of object in MP is changed. The event handler only triggers on the computers that are directly involved in change of locality.\nSo if EH is added to every computer on network, it will only trigger on 2 computers, on the computer that receives ownership of the object (new owner), in which case _this select 1 will be true,\nand on the computer from which ownership is transferred (old owner), in which case _this select 1 will be false.\n\n```sqf\nthis addEventHandler [\"Local\", {\n    params [\"_entity\", \"_isLocal\"];\n}];\n```\n\n- entity: Object - the object that changed locality\n- isLocal: Boolean - if the object is local on given computer"},{"heading":"MagazineReloading (Arma 3 v2.18)","level":4,"markdown":"Local Argument\n\nTriggers when reloading starts.\n\n```sqf\nthis addEventHandler [\"MagazineReloading\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_magazine\", \"_magazineClass\", \"_ammoCount\", \"_magazineID\", \"_magazineCreator\"];\n}];\n```\n\n- unit: Object - unit or vehicle to which EH is assigned\n- weapon: String - weapon that got unloaded\n- muzzle: String - weapon's muzzle that got unloaded\n- magazine: Array - magazine info in format [magazineClass, ammoCount, magazineID, magazineCreator], where:\n  - magazineClass: String - class name of the magazine\n  - ammoCount: Number - amount of ammo in magazine\n  - magazineID: Number - global magazine id\n  - magazineCreator: Number - owner of the magazine creator"},{"heading":"MagazineUnloaded (Arma 3 v2.18)","level":4,"markdown":"Local Argument\n\nTriggers when a magazine is removed from a weapon manually or via script.\n\n```sqf\nthis addEventHandler [\"MagazineUnloaded\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_magazine\", \"_magazineClass\", \"_ammoCount\", \"_magazineID\", \"_magazineCreator\"];\n}];\n```\n\n- unit: Object - unit or vehicle to which EH is assigned\n- weapon: String - weapon that got unloaded\n- muzzle: String - weapon's muzzle that got unloaded\n- magazine: Array - magazine info in format [magazineClass, ammoCount, magazineID, magazineCreator], where:\n  - magazineClass: String - class name of the magazine\n  - ammoCount: Number - amount of ammo in magazine\n  - magazineID: Number - global magazine id\n  - magazineCreator: Number - owner of the magazine creator"},{"heading":"OpticsModeChanged (Arma 3 v2.10)","level":4,"markdown":"Local Argument\n\nTriggers everytime a local unit changes optic mode. This could be either through the setOpticsMode command or by the player switching to the next optic mode using e.g <kbd>NUM /</kbd> or <kbd>Ctrl</kbd>+<kbd>RMB</kbd>.\n\n```sqf\nthis addEventHandler [\"OpticsModeChanged\", {\n    params [\"_unit\", \"_opticsClass\", \"_newMode\", \"_oldMode\", \"_isADS\"];\n}];\n```\n\n- unit: Object - the unit\n- opticsClass: String\n- newMode: String\n- oldMode: String\n- isADS: Boolean - if the new view is GUNNER"},{"heading":"OpticsSwitch (Arma 3 v2.10)","level":4,"markdown":"Local Argument\n\nTriggers at the start of the camera transition from GUNNER to INTERNAL/EXTERNAL and vice-versa.\nSo anytime the right mouse button is pressed and there is a GUNNER view available or are currently in it, this triggers.\nWorks in vehicles and FFV as well. See also cameraView.\n\n```sqf\nthis addEventHandler [\"OpticsSwitch\", {\n    params [\"_unit\", \"_isADS\"];\n}];\n```\n\n- unit: Object - the unit\n- isADS: Boolean - if the new view is GUNNER"},{"heading":"PathCalculated (Arma 3 v1.94)","level":4,"markdown":"Local Argument\n\nTriggers when a path has been calculated for the unit. Works for both agents and normal AI units.\n\nNote that paths to far destinations are typically calculated in segments.\nWhen the unit completes a segment, a new path is calculated and this is continued until the unit reaches its destination.\n\n```sqf\nthis addEventHandler [\"PathCalculated\", {\n    params [\"_unit\", \"_path\"];\n}];\n```\n\n- unit: Object - the unit/agent for which the path was calculated\n- path: Array - the array of positions representing the path (PositionASL)"},{"heading":"PeriscopeElevationChanged (Arma 3 v2.00)","level":4,"markdown":"Fires every frame during periscope elevation animation.\n\n```sqf\nthis addEventHandler [\"PeriscopeElevationChanged\", {\n    params [\"_vehicle\", \"_turret\", \"_elevation\", \"_direction\", \"_userIsBlocked\"];\n}];\n```\n\n- vehicle: Object - the vehicle this EH is assigned to\n- turret: Array - the turret which periscope is changing elevation\n- elevation: Number - current periscope elevation (changes with each simulation). See also periscopeElevation, elevatePeriscope\n- direction: Number - 1: moves up, 0: stopped, -1: moves down; when `direction` returns 0, this also means the event handler fired for the last time for this elevation.\n- userIsBlocked: Boolean - whether or not the user ability to override is blocked. See also periscopeElevation, elevatePeriscope"},{"heading":"PostInit (Arma 3 v2.06)","level":4,"markdown":"Global Argument\n\nTriggered whenever an entity is created and initialized. Cannot be used in scripts, only inside class Eventhandlers in config.\n\n> [!IMPORTANT]\n> It is recommended to use this event handler instead of the #Init one when setting entity textures (setObjectTexture, BIS_fnc_initVehicle etc) to avoid networking issues.\n\ne.g:\n\n```cpp\npostInit = \"params ['_entity'];\";\n```\n\n```cpp\npostinit = \"params ['_entity']; if (local _entity) then { [_entity, '', [], false] call BIS_fnc_initVehicle };\";\n```\n\n```sqf\nparams [\"_entity\"];\n```\n\n- entity: Object - object the event handler is assigned to"},{"heading":"PostReset","level":4,"markdown":"**Obsolete** - triggers after PP effects have been reset by the engine."},{"heading":"Put (Arma 3 v0.56)","level":4,"markdown":"Global Argument\n\nTriggers when a unit puts an item in a container.\n\nArma 3 v2.14 This event handler can be added to a container.\n\n```sqf\nthis addEventHandler [\"Put\", {\n    params [\"_unit\", \"_container\", \"_item\"];\n}];\n```\n\n- unit: Object - unit who put the item in the container\n- container: Object - the container into which the item was placed (vehicle, box, etc.)\n- item: String - the class name of the moved item\n\n> [!NOTE]\n> This EH could also trigger when unit replaces magazine in weapon with another magazine from unit containers (uniform, vest, backpack) during reload."},{"heading":"PylonChanged (Arma 3 v2.20)","level":4,"markdown":"Local Argument\n\nTriggers when an aircraft's pylon changes magazine type:\n\n```sqf\nvehicle player addEventHandler [\"PylonChanged\", {\n    params [\"_vehicle\", \"_pylonIndex\", \"_oldMagazine\", \"_newMagazine\"];\n}];\n```\n\n- vehicle: Object\n- pylonIndex: Number\n- oldMagazine: String\n- newMagazine: String\n\n> [!IMPORTANT]\n> This event generally triggers **twice** for a swap, first unload then load, e.g:\n>\n> ```sqf\n> // [myVehicle, 1, \"oldMagClass\", \"\"]\n> // [myVehicle, 1, \"\", \"newMagClass\"]\n> ```"},{"heading":"Reloaded (Arma 3 v1.58)","level":4,"markdown":"Local Argument\n\nTriggers once a weapon is reloaded with a new magazine. For more information, see Reloaded.\n\n```sqf\nthis addEventHandler [\"Reloaded\", {\n    params [\"_unit\", \"_weapon\", \"_muzzle\", \"_newMagazine\", \"_oldMagazine\"];\n}];\n```\n\n- unit: Object - unit or vehicle to which EH is assigned\n- weapon: String - weapon that got reloaded\n- muzzle: String - weapon's muzzle that got reloaded\n- newMagazine: Array - new magazine info\n- oldMagazine: Array or Nothing - old magazine info"},{"heading":"Respawn","level":4,"markdown":"Local Argument\n\nTriggered when a unit respawns.\n\n```sqf\nthis addEventHandler [\"Respawn\", {\n    params [\"_unit\", \"_corpse\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- corpse: Object - object the event handler was assigned to, aka the corpse/unit player was previously controlling"},{"heading":"RopeAttach (Arma 3 v1.34)","level":4,"markdown":"Triggered when a rope is attached to an object.\n\nIn the case of sling loading, this event handler must be assigned to the helicopter and will trigger for each attached rope.\n\n```sqf\nthis addEventHandler [\"RopeAttach\", {\n    params [\"_object1\", \"_rope\", \"_object2\"];\n}];\n```\n\n- object1: Object - object to which the event handler is assigned.\n- rope: Object - the rope being attached between object 1 and object 2.\n- object2: Object - the object that is being attached to object 1 via rope."},{"heading":"RopeBreak (Arma 3 v1.34)","level":4,"markdown":"Triggered when a rope is detached from an object.\n\nIn the case of sling loading, this event handler must be assigned to the helicopter and will trigger for each detached rope.\n\n```sqf\nthis addEventHandler [\"RopeBreak\", {\n    params [\"_object1\", \"_rope\", \"_object2\"];\n}];\n```\n\n- object1: Object - object to which the event handler is assigned.\n- rope: Object - the rope that connected object 1 and object 2.\n- object2: Object - the object that was connected to object 1 with a rope."},{"heading":"SeatSwitched (Arma 3 v1.50)","level":4,"markdown":"Global Argument\n\nTriggered when unit changes seat within vehicle. EH returns both units switching seats.\nIf switching seats with an empty seat, one of the returned units will be objNull.\nThe new position can be obtained with assignedVehicleRole.\nThis EH must be assigned to a vehicle.\n\n```sqf\nthis addEventHandler [\"SeatSwitched\", {\n    params [\"_vehicle\", \"_unit1\", \"_unit2\"];\n}];\n```\n\n- vehicle: Object - vehicle to which the event handler is assigned.\n- unit1: Object - unit switching seat.\n- unit2: Object - unit switching seat."},{"heading":"SeatSwitchedMan (Arma 3 v1.58)","level":4,"markdown":"Global Argument\n\nTriggered when unit changes seat within vehicle. EH returns both units switching seats.\nIf switching seats with an empty seat, one of the returned units will be objNull.\nThe new position can be obtained with assignedVehicleRole <unit>. This EH must be assigned to a unit and not a vehicle.\nThis EH is persistent and will be transferred to the new unit after respawn, but only if it was assigned where unit was local.\n\n```sqf\nthis addEventHandler [\"SeatSwitchedMan\", {\n    params [\"_unit1\", \"_unit2\", \"_vehicle\"];\n}];\n```\n\n- unit1: Object - unit switching seat.\n- unit2: Object - unit with which unit1 is switching seat.\n- vehicle: Object - vehicle where switching seats is taking place."},{"heading":"SelectedActionChanged","level":4,"markdown":"RTM helicopter user action event\n\n```sqf\nthis addEventHandler [\"SelectedActionChanged\", {\n    params [\"_caller\", \"_target\", \"_enumNumber\", \"_actionId\"];\n}];\n```\n\n> [!IMPORTANT]\n> Limited or non-existent functionality."},{"heading":"SelectedActionPerformed","level":4,"markdown":"RTM helicopter user action event\n\n```sqf\nthis addEventHandler [\"SelectedActionPerformed\", {\n    params [\"_caller\", \"_target\", \"_enumNumber\", \"_actionId\"];\n}];\n```\n\n> [!IMPORTANT]\n> Limited or non-existent functionality."},{"heading":"SelectedRotorLibActionChanged","level":4,"markdown":"RTM helicopter user action event\n\n```sqf\nthis addEventHandler [\"SelectedRotorLibActionChanged\", {\n    params [\"_caller\", \"_target\", \"_enumNumber\", \"_actionId\"];\n}];\n```\n\n> [!IMPORTANT]\n> Limited or non-existent functionality."},{"heading":"SelectedRotorLibActionPerformed","level":4,"markdown":"RTM helicopter user action event\n\n```sqf\nthis addEventHandler [\"SelectedRotorLibActionPerformed\", {\n    params [\"_caller\", \"_target\", \"_enumNumber\", \"_actionId\"];\n}];\n```\n\n> [!IMPORTANT]\n> Works only for key press combination <kbd>RCtrl</kbd>+<kbd>W</kbd>, which is the binding for helicopter wheels brakes.\n> It fires with or without Advanced Flight Model enabled. The enum number returned is 4 and 5, probably because the enum is structured like this:\n> - 0: HelicopterAutoTrimOn\n> - 1: HelicopterAutoTrimOff\n> - 2: HelicopterTrimOn\n> - 3: HelicopterTrimOff\n> - 4: WheelsBrakeOn\n> - 5: WheelsBrakeOff"},{"heading":"SlotItemChanged (Arma 3 v2.14)","level":4,"markdown":"Global Argument\n\nTriggered when any of the following slots get assigned or unassigned: *Items* - Map, GPS, Radio, Watch, Compass, Helmet, Goggles, NVG; *Weapon* - Binoculars; *Containers* - Uniform, Vest, Backpack.\n\n```sqf\nthis addEventHandler [\"SlotItemChanged\", {\n    params [\"_unit\", \"_name\", \"_slot\", \"_assigned\", \"_weapon\"];\n}];\n```\n\n- unit: Object - unit EH assigned to.\n- name: String - name of the item/weapon/container (see getSlotItemName).\n- slot: Number - slot id (see getSlotItemName).\n- assigned: Boolean - true assign action, false unassign action.\n- Arma 3 v2.18 weapon: String - name of weapon in event that slot changed is a weapon attachment slot"},{"heading":"SoundPlayed (Arma 3 v0.56)","level":4,"markdown":"Local Argument\n\nTriggered when player is making noises when injured or fatigued for example. The number param passed to the EH code points to the sound origin:\n1. Breath\n1. Breath Injured\n1. Breath Scuba\n1. Injured\n1. Pulsation\n1. Hit Scream\n1. Burning\n1. Drowning\n1. Drown\n1. Gasping\n1. Stabilizing\n1. Healing\n1. Healing With Medikit\n1. Recovered\n1. Breath Held\n\n```sqf\nthis addEventHandler [\"SoundPlayed\", {\n    params [\"_unit\", \"_soundID\"];\n}];\n```\n\n- unit: Object - unit to which the event handler is assigned\n- soundID: Number - sound origin\n\n> [!NOTE]\n> Since Arma 3 v2.12 returning a Number from last added EH in range from 0 to 5 will alter the volume of played sound from mute to max volume."},{"heading":"Suppressed (Arma 3 v2.02)","level":4,"markdown":"Local Argument\n\nTriggers when enemy projectile is passing by closer than defined suppression radius ammo value in config.\nCan be made to trigger for the same side if the side is set as enemy to itself (with setFriend). For more information see Arma 3: Suppression.\n\n```sqf\nthis addEventHandler [\"Suppressed\", {\n    params [\"_unit\", \"_distance\", \"_shooter\", \"_instigator\", \"_ammoObject\", \"_ammoClassName\", \"_ammoConfig\"];\n}];\n```\n\n- unit: Object - unit to which the event is assigned\n- distance: Number - distance of the projectile pass-by\n- shooter: Object - who (or what) fired - vehicle or drone\n- instigator: Object - who pressed the trigger. Instigator is different from the shooter when player is operator of UAV for example\n- ammoObject: Object - the ammunition itself\n- ammoClassName: String - the ammunition's classname\n- ammoConfig: Config - the ammunition's CfgAmmo config path"},{"heading":"Take (Arma 3 v0.56)","level":4,"markdown":"Global Argument\n\nTriggers when a unit takes an item from a container.\n\nArma 3 v2.14 This event handler can be added to a container.\n\n```sqf\nthis addEventHandler [\"Take\", {\n    params [\"_unit\", \"_container\", \"_item\"];\n}];\n```\n\n- unit: Object - unit who took the item from the container\n- container: Object - the container from which the item was taken (vehicle, box, etc.)\n- item: String - the class name of the taken item\n\n> [!NOTE]\n> This EH could also trigger when unit replaces magazine in weapon with another magazine from unit containers (uniform, vest, backpack) during reload."},{"heading":"TaskSetAsCurrent (Arma 3 v1.32)","level":4,"markdown":"Triggers when player's current task changes\n\n```sqf\nthis addEventHandler [\"TaskSetAsCurrent\", {\n    params [\"_unit\", \"_task\"];\n}];\n```\n\n- unit: Object - the player to whom the event handler is assigned\n- task: Task - the new current task"},{"heading":"TurnIn (Arma 3 v1.66)","level":4,"markdown":"Triggers when member of crew in a vehicle uses Turn In action\n\n```sqf\nthis addEventHandler [\"TurnIn\", {\n    params [\"_vehicle\", \"_unit\", \"_turret\"];\n}];\n```\n\n- vehicle: Object - the vehicle the event handler is assigned to\n- unit: Object - the unit performing the Turn In action\n- turret: Array - turret path"},{"heading":"TurnOut (Arma 3 v1.66)","level":4,"markdown":"Triggers when member of crew in a vehicle uses Turn Out action\n\n```sqf\nthis addEventHandler [\"TurnOut\", {\n    params [\"_vehicle\", \"_unit\", \"_turret\"];\n}];\n```\n\n- vehicle: Object - the vehicle the event handler is assigned to\n- unit: Object - the unit performing the Turn Out action\n- turret: Array - turret path"},{"heading":"VisionModeChanged (Arma 3 v2.08)","level":4,"markdown":"Triggers when the assigned vehicle/unit's vision mode has changed.\n\n```sqf\nplayer addEventHandler [\"VisionModeChanged\", {\n    params [\"_person\", \"_visionMode\", \"_TIindex\", \"_visionModePrev\", \"_TIindexPrev\", \"_vehicle\", \"_turret\"];\n}];\n```\n\n- person: Object - unit for whom the vision mode changes\n- visionMode: Number - vision mode index\n- TIindex: Number - thermal vision mode index; will return -1 when *visionMode* is not 2\n- visionModePrev: Number - last vision mode\n- TIindexPrev: Number - last TI mode; will return -1 when *visionModePrev* is not 2\n- vehicle: Object - if unit is in a vehicle or controlling a UAV, this will be the vehicle\n- turret: Array - turret path to the turret occupied by the unit, or [] if not on turret"},{"heading":"WeaponAssembled","level":4,"markdown":"Global Argument\n\nTriggers when a weapon gets assembled. EH must be attached to the unit and not the weapon.\n\n```sqf\nthis addEventHandler [\"WeaponAssembled\", {\n    params [\"_unit\", \"_weapon\", \"_primaryBag\", \"_secondaryBag\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- weapon: Object - object of the assembled weapon\n- Arma 3 v2.18 primaryBag: Object - primary bag (just before it is deleted)\n- Arma 3 v2.18 secondaryBag: Object - secondary bag (just before it is deleted)"},{"heading":"WeaponChanged (Arma 3 v2.18)","level":4,"markdown":"Fires on weapon switch and firemode switch. Does not fire for player units inside vehicles (but does fire for vehicles with players in them).\n\nThe locality is unknown, but it is known that this EH behaves like currentWeapon, currentWeaponMode and currentMuzzle in terms of locality.\n\nArma 3 v2.22 Fires for \"Throw\" muzzle changes too.\n\n```sqf\nthis addEventHandler [\"WeaponChanged\", {\n    params [\"_object\", \"_oldWeapon\", \"_newWeapon\", \"_oldMode\", \"_newMode\", \"_oldMuzzle\", \"_newMuzzle\", \"_turretIndex\"];\n}];\n```\n\n- object: Object - the unit or vehicle the event handler is assigned to\n- oldWeapon: String - the class name of the previous weapon\n- newWeapon: String - the class name of the new weapon (same as currentWeapon)\n- oldMode: String - the previous weapon mode\n- newMode: String - the new weapon mode (same as currentWeaponMode)\n- oldMuzzle: String - the previous weapon muzzle\n- newMuzzle: String - the new weapon muzzle (same as currentMuzzle)\n- turretIndex: Array format Turret Path - the turret path, or empty array if `object` is not a transport vehicle"},{"heading":"WeaponDeployed (Arma 3 v1.44)","level":4,"markdown":"Global Argument\n\nTriggers when the deployed state of a weapon or bipod changes.\n\n**Note:** A weapon cannot be rested and deployed at the same time.\n\n```sqf\nthis addEventHandler [\"WeaponDeployed\", {\n    params [\"_unit\", \"_isDeployed\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- isDeployed: Boolean - true if deployed"},{"heading":"WeaponDisassembled","level":4,"markdown":"Global Argument\n\nTriggers when a weapon gets disassembled. EH must be attached to the unit and not the weapon.\n\n**Note:** As of Arma 3 v1.32, this event does not fire if the weapon is not local.\n\n```sqf\nthis addEventHandler [\"WeaponDisassembled\", {\n    params [\"_unit\", \"_primaryBag\", \"_secondaryBag\", \"_weapon\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- primaryBag: Object - first backpack object which was weapon disassembled into\n- secondaryBag: Object - second backpack object which was weapon disassembled into\n- Arma 3 v2.18 weapon: Object - disassembled weapon (just before it is moved out of the world)"},{"heading":"WeaponRested (Arma 3 v1.44)","level":4,"markdown":"Local Argument\n\nTriggers when weapon rested state changes (weapon near a surface that can provide weapon support).\n\n**Note:** A weapon cannot be rested and deployed at the same time.\n\n```sqf\nthis addEventHandler [\"WeaponRested\", {\n    params [\"_unit\", \"_isRested\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- isRested: Boolean - true if rested"},{"heading":"Multiplayer Event Handlers","level":3,"markdown":"Global object event handler, executed on every connected machine.\n\nCommands:\n- addMPEventHandler\n- removeMPEventHandler\n- removeAllMPEventHandlers\n\n> [!IMPORTANT]\n> A Multiplayer Event Handler is **not** saved in a save file and therefore will not be restored on load - use it accordingly."},{"heading":"MPHit","level":4,"markdown":"Global ArgumentGlobal Effect\n\nTriggered when the unit is hit/damaged. EH can be added on any machine and EH code will trigger globally on every connected client and server.\nThis EH is clever enough to be triggered globally only once even if added on all clients or a single client that is then disconnected, EH will still trigger globally only once.\n\nIs *not* always triggered when unit is killed by a hit.\nMost of the time only the killed event handler is triggered when a unit dies from a hit.\nThe hit EH will not necessarily fire if only minor damage occurred (e.g. firing a bullet at a tank), even though the damage increased.\nCan also trigger several times for an explosion (direct and indirect damage). Does not fire when a unit is set to allowDamage false.\nHowever it will fire with \"HandleDamage\" EH added alongside stopping unit from taking damage (`unit addEventHandler [\"HandleDamage\", { 0 }];`.\nWill not trigger once the unit is dead.\n\n**Note:** call a function from the MPHit EH code space rather than defining the full code in there directly.\nThe reason is the code space will be transferred over network on each event activation - so keep the data as small as possible!\n\n```sqf\nthis addMPEventHandler [\"MPHit\", {\n    params [\"_unit\", \"_causedBy\", \"_damage\", \"_instigator\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n\n- causedBy: Object - object that caused the damage. Contains the unit itself in case of collisions.\n\n- damage: Number - level of damage caused by the hit\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger"},{"heading":"MPKilled","level":4,"markdown":"Global ArgumentGlobal Effect\n\nTriggered when the unit is killed. EH can be added on any machine and EH code will trigger globally **on every connected client and server**.\nThis EH has a safeguard measure so that even if it's added on all clients or a single client that is then disconnected, EH will still trigger globally only once per client.\n\n```sqf\nthis addMPEventHandler [\"MPKilled\", {\n    params [\"_unit\", \"_killer\", \"_instigator\", \"_useEffects\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- killer: Object - object that killed the unit. Contains the unit itself in case of collisions\n- Arma 3 v1.66 instigator: Object - person who pulled the trigger\n- Arma 3 v1.68 useEffects: Boolean - same as *useEffects* in setDamage alt syntax"},{"heading":"MPRespawn","level":4,"markdown":"Global ArgumentLocal Effect\n\nTriggered when a unit, it is assigned to, respawns. This EH does not work as one would expect MP EH should work like.\nIt is only triggered on one machine where the unit it was assigned to is local.\nThe only difference between **Respawn** and **MPRespawn** is that **MPRespawn** can be assigned from anywhere while **Respawn** requires the unit to be local.\n\nMPRespawn EH expects the EH code to return an array in Position format which will be used to place the respawned unit at the desired coordinates.\n\nFor example: `player addMPEventHandler [\"MPRespawn\", { [1234, 1234, 0] }];` will place player at [1234,1234,0] immediately on respawn.\n\n```sqf\nthis addMPEventHandler [\"MPRespawn\", {\n    params [\"_unit\", \"_corpse\"];\n}];\n```\n\n- unit: Object - object the event handler is assigned to\n- corpse: Object - object the event handler was assigned to, aka the corpse/unit player was previously controlling."},{"heading":"Mission Event Handlers","level":3,"markdown":"Mission Event Handlers are specific EHs that are anchored to the running mission and automatically removed when mission is over.\n\nCommands:\n- addMissionEventHandler\n- removeMissionEventHandler\n\n> [!NOTE]\n> See Arma 3: Mission Event Handlers."},{"heading":"Curator Event Handlers (Arma 3 v1.16)","level":3,"markdown":"Local ArgumentLocal Effect\n\nArma 3: Curator Event Handlers are also added with the addEventHandler command. They are executed only where the curator is local - on the machine that is in control of it.\n\n> [!IMPORTANT]\n> These Event Handlers must be added to the curator object/module, **not** the player!\n\nCommands:\n- addEventHandler\n- removeEventHandler\n- removeAllEventHandlers"},{"heading":"CuratorFeedbackMessage","level":4,"markdown":"Local Argument\n\nTriggered when curator attempts invalid action in curator interface.\n\nEach error has its own unique ID, recognized values are:\n\n- 003 - when trying to teleport camera outside of curatorCameraArea\n- 101 - trying to place an object when placing is disabled using setCuratorCoef \"place\"\n- 102 - trying to place an object which is too expensive (cost set in *curatorObjectRegistered* multiplied by setCuratorCoef \"place\" is larger than curatorPoints)\n- 103 - trying to place an object outside of curatorEditingArea\n- 104 - items of a placed composition were skipped / could not be placed (since Arma 3 v2.06)\n- 201 - trying to place a waypoint when waypoint placing is disabled\n- 202 - trying to place a waypoint which is too expensive (cost set by setCuratorWaypointCost multiplied by setCuratorCoef \"place\" is larger than curatorPoints)\n- 206 - trying to place a waypoint when no AI unit is selected\n- 301 - trying to move or rotate an entity when editing is disabled using setCuratorCoef \"edit\"\n- 302 - trying to move or rotate an entity when it is too expensive (entity cost multiplied by setCuratorCoef \"edit\" is larger than curatorPoints)\n- 303 - trying to move an entity outside of curatorEditingArea\n- 304 - trying to move or rotate an entity which is outside of curatorEditingArea\n- 307 - trying to move or rotate a player (players cannot be manipulated with)\n- 401 - trying to delete an entity when deleting is disabled using setCuratorCoef \"delete\"\n- 402 - trying to delete an entity which is too expensive (cost multiplied by setCuratorCoef \"delete\" is larger than curatorPoints)\n- 404 - trying to delete an entity which is outside of curatorEditingArea\n- 405 - trying to delete an entity which has non-editable crew in it\n- 407 - trying to delete a player (players cannot be manipulated with)\n- 501 - trying to destroy an object when destroying is disabled using setCuratorCoef \"destroy\"\n- 502 - trying to destroy an object which is too expensive (cost multiplied by setCuratorCoef \"destroy\" is larger than curatorPoints)\n- 504 - trying to destroy an object which is outside of curatorEditingArea\n- 505 - trying to destroy an object which has non-editable crew in it\n- 506 - trying to destroy an object when no object is selected\n- 507 - trying to destroy a player (players cannot be manipulated with)\n\n```sqf\nthis addEventHandler [\"CuratorFeedbackMessage\", {\n    params [\"_curator\", \"_errorID\"];\n}];\n```\n\n- curator: Object\n- errorID: Number"},{"heading":"CuratorGroupDoubleClicked","level":4,"markdown":"Local Argument\n\nTriggered when a group is double-clicked on in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorGroupDoubleClicked\", {\n    params [\"_curator\", \"_group\"];\n}];\n```\n\n- curator: Object\n- group: Group"},{"heading":"CuratorGroupPlaced","level":4,"markdown":"Local Argument\n\nTriggered when new group is placed in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorGroupPlaced\", {\n    params [\"_curator\", \"_group\"];\n}];\n```\n\n- curator: Object\n- group: Group"},{"heading":"CuratorGroupSelectionChanged","level":4,"markdown":"Local Argument\n\nTriggered when a group is selected in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorGroupSelectionChanged\", {\n    params [\"_curator\", \"_group\"];\n}];\n```\n\n- curator: Object\n- group: Group"},{"heading":"CuratorMarkerDeleted","level":4,"markdown":"Local Argument\n\nTriggered when a marker is deleted in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerDeleted\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String"},{"heading":"CuratorMarkerDoubleClicked","level":4,"markdown":"Local Argument\n\nTriggered when a marker is double-clicked on in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerDoubleClicked\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String"},{"heading":"CuratorMarkerEdited","level":4,"markdown":"Local Argument\n\nTriggered when a marker is moved in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerEdited\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String"},{"heading":"CuratorMarkerPlaced","level":4,"markdown":"Local Argument\n\nTriggered when new marker is placed in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerPlaced\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String"},{"heading":"CuratorMarkerSelectionChanged","level":4,"markdown":"Local Argument\n\nTriggered when a marker is selected in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorMarkerSelectionChanged\", {\n    params [\"_curator\", \"_marker\"];\n}];\n```\n\n- curator: Object\n- marker: String"},{"heading":"CuratorObjectDeleted","level":4,"markdown":"Local Argument\n\nTriggered when an object is deleted in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorObjectDeleted\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object"},{"heading":"CuratorObjectDoubleClicked","level":4,"markdown":"Local Argument\n\nTriggered when an object is double-clicked on in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorObjectDoubleClicked\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object"},{"heading":"CuratorObjectEdited","level":4,"markdown":"Local Argument\n\nTriggered when an object is moved or rotated in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorObjectEdited\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object"},{"heading":"CuratorObjectPlaced","level":4,"markdown":"Local Argument\n\nTriggered when new object is placed in curator interface.\nThis event handler will trigger individually for each unit in a placed group - excluding the crew in vehicles.\n\n```sqf\nthis addEventHandler [\"CuratorObjectPlaced\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object"},{"heading":"CuratorObjectRegistered","level":4,"markdown":"Local Argument\n\nTriggered when player enters curator interface. Assign curator cost to every object in the game.\nThis is the primary method that a mission designer can use to limit the objects a curator can place.\n\n> [!NOTE]\n> See Curator#Manual Assigning.\n\n```sqf\nthis addEventHandler [\"CuratorObjectRegistered\", {\n    params [\"_curator\", \"_input\"];\n}];\n```\n\n- curator: Object\n- input: Array of Strings - all CfgVehicles classes"},{"heading":"CuratorObjectSelectionChanged","level":4,"markdown":"Local Argument\n\nTriggered when an object is selected in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorObjectSelectionChanged\", {\n    params [\"_curator\", \"_entity\"];\n}];\n```\n\n- curator: Object\n- entity: Object"},{"heading":"CuratorPinged","level":4,"markdown":"Local Argument\n\nTriggered when a player pings his curator(s) by pressing the *Zeus* key.\n\n```sqf\nthis addEventHandler [\"CuratorPinged\", {\n    params [\"_curator\", \"_player\"];\n}];\n```\n\n- curator: Object\n- player: Object"},{"heading":"CuratorSelectionPresetLoaded (Arma 3 v2.14)","level":4,"markdown":"Local Argument\n\nTriggered when a selection preset is loaded using the respective number key or through script.\n\n```sqf\nthis addEventHandler [\"CuratorSelectionPresetLoaded\", {\n    params [\"_curator\", \"_numkey\"];\n}];\n```\n\n- curator: Object\n- numkey: Number"},{"heading":"CuratorSelectionPresetSaved (Arma 3 v2.14)","level":4,"markdown":"Local Argument\n\nTriggered when a selection preset is saved using the respective CTRL + number key or set through script.\n\n```sqf\nthis addEventHandler [\"CuratorSelectionPresetSaved\", {\n    params [\"_curator\", \"_numkey\"];\n}];\n```\n\n- curator: Object\n- numkey: Number"},{"heading":"CuratorWaypointDeleted","level":4,"markdown":"Local Argument\n\nTriggered when a waypoint is deleted in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointDeleted\", {\n    params [\"_curator\", \"_waypoint\"];\n}];\n```\n\n- curator: Object\n- waypoint: Array"},{"heading":"CuratorWaypointDoubleClicked","level":4,"markdown":"Local Argument\n\nTriggered when a waypoint is double-clicked on in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointDoubleClicked\", {\n    params [\"_curator\", \"_waypoint\"];\n}];\n```\n\n- curator: Object\n- waypoint: Array"},{"heading":"CuratorWaypointEdited","level":4,"markdown":"Local Argument\n\nTriggered when a waypoint is moved in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointEdited\", {\n    params [\"_curator\", \"_group\", \"_waypointID\"];\n}];\n```\n\n- curator: Object\n- group: Group\n- waypointID: Number"},{"heading":"CuratorWaypointPlaced","level":4,"markdown":"Local Argument\n\nTriggered when new waypoint is placed in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointPlaced\", {\n    params [\"_curator\", \"_group\", \"_waypointID\"];\n}];\n```\n\n- curator: Object\n- group: Group\n- waypointID: Number"},{"heading":"CuratorWaypointSelectionChanged","level":4,"markdown":"Local Argument\n\nTriggered when a waypoint is selected in curator interface.\n\n```sqf\nthis addEventHandler [\"CuratorWaypointSelectionChanged\", {\n    params [\"_curator\", \"_waypoint\"];\n}];\n```\n\n- curator: Object\n- waypoint: Array"},{"heading":"UserAction Event Handlers (Arma 3 v2.06)","level":3,"markdown":"UserAction Event Handlers are events that trigger on user action.\n\nCommands:\n- addUserActionEventHandler\n- removeUserActionEventHandler\n\n> [!NOTE]\n> See Arma 3: Modded Keybinding."},{"heading":"Activate","level":4,"markdown":"```sqf\naddUserActionEventHandler [\"KeyName\", \"Activate\", {\n    params [\"_activated\"];\n}];\n```\n\n- activated: Boolean - always returns true"},{"heading":"Deactivate","level":4,"markdown":"```sqf\naddUserActionEventHandler [\"KeyName\", \"Deactivate\", {\n    params [\"_activated\"];\n}];\n```\n\n- activated: Boolean - always returns false"},{"heading":"Analog","level":4,"markdown":"```sqf\naddUserActionEventHandler [\"KeyName\", \"Analog\", {\n    params [\"_value\"];\n}];\n```\n\n- value: Number - input device's analog value"},{"heading":"Projectile Event Handlers (Arma 3 v2.10)","level":3,"markdown":"Commands:\n- addEventHandler\n- removeEventHandler\n- removeAllEventHandlers"},{"heading":"Deleted (Projectile)","level":4,"markdown":"```sqf\n_projectile addEventHandler [\"Deleted\", {\n    params [\"_projectile\"];\n}];\n```\n\n- projectile: Object"},{"heading":"Deflected","level":4,"markdown":"```sqf\n_projectile addEventHandler [\"Deflected\", {\n    params [\"_projectile\", \"_position\", \"_velocity\", \"_hitObject\"];\n}];\n```\n\n- projectile: Object\n- position: Array format PositionASL\n- velocity: Array format Vector3D\n- hitObject: Object - the object that deflected the projectile"},{"heading":"Explode","level":4,"markdown":"Local Argument\n\n```sqf\n_projectile addEventHandler [\"Explode\", {\n    params [\"_projectile\", \"_position\", \"_velocity\"];\n}];\n```\n\n- projectile: Object\n- position: Array format PositionASL\n- velocity: Array format Vector3D"},{"heading":"HitExplosion","level":4,"markdown":"```sqf\n_projectile addEventHandler [\"HitExplosion\", {\n    params [\"_projectile\", \"_hitEntity\", \"_projectileOwner\", \"_hitSelections\", \"_instigator\"];\n}];\n```\n\n- projectile: Object\n- hitEntity: Object\n- projectileOwner: Object\n- hitSelections: Array of Arrays - same list of FireGeometry components that #HitPart (Entity) gets but only contains:\n  - position: Array format PositionASL - position of impact\n  - vector: Array format Vector3D - vector that is orthogonal (perpendicular) to the surface struck. For example, if a wall was hit, vector would be pointing out of the wall at a 90 degree angle\n  - selection: String - named selection of the object that was hit, in the FireGeometry LOD.\n  - radius: Number - radius (size) of component hit\n  - surface: String - surface type struck\n- Arma 3 v2.18 instigator: Object - shot instigator"},{"heading":"HitPart (Projectile)","level":4,"markdown":"Triggered when the projectile hits any surface.\n\n```sqf\n_projectile addEventHandler [\"HitPart\", {\n    params [\"_projectile\", \"_hitEntity\", \"_projectileOwner\", \"_pos\", \"_velocity\", \"_normal\", \"_components\", \"_radius\" ,\"_surfaceType\", \"_instigator\"];\n}];\n```\n\n- projectile: Object\n- hitEntity: Object\n- projectileOwner: Object\n- pos: Array format PositionASL\n- velocity: Array format Vector3D\n- normal: Array format Vector3D\n- components: Array of Strings - the selections that were hit, in the FireGeometry LOD.\n- radius: Number - radius (size) of the hitPoint\n- surfaceType: String\n- Arma 3 v2.18 instigator: Object - shot instigator\n\n> [!IMPORTANT]\n> This event handler only triggers for direct hits and not splash damage, unlike #HitPart (Entity). For splash damage, use #HitExplosion."},{"heading":"Init (Projectile)","level":4,"markdown":"Triggered whenever a projectile is created. Cannot be used in scripts, only inside class Eventhandlers in config.\n\n```cpp\ninit = \"params ['_projectile'];\";\n```\n\n```sqf\nparams [\"_projectile\"];\n```\n\n- projectile: Object - object the event handler is assigned to"},{"heading":"MineActivated (Arma 3 v2.14)","level":4,"markdown":"Local Argument\nLocal Effect\n\n```sqf\n_projectile addEventHandler [\"MineActivated\", {\n    params [\"_projectile\", \"_isActive\"];\n}];\n```\n\n- projectile: Object\n- isActive: Boolean - new active state of the mine"},{"heading":"Penetrated","level":4,"markdown":"This event fires as many times as the projectile penetrates a surface.\n\n```sqf\n_projectile addEventHandler [\"Penetrated\", {\n    params [\"_projectile\", \"_hitObject\", \"_surfaceType\", \"_entryPoint\", \"_exitPoint\", \"_exitVector\"];\n}];\n```\n\n- projectile: Object\n- hitObject: Object\n- surfaceType: String - see surfaceType\n- entryPoint: Array format PositionASL - the projectile's entry point\n- exitPoint: Array format PositionASL - the projectile's exit point\n- exitVector: Array format Vector3D - speed/angle exit vector (see vectorMagnitude to obtain the speed, in metre per second)"},{"heading":"SubmunitionCreated","level":4,"markdown":"This event fires as many times as submunitions are created.\n\n```sqf\n_projectile addEventHandler [\"SubmunitionCreated\", {\n    params [\"_projectile\", \"_submunitionProjectile\", \"_position\", \"_velocity\"];\n}];\n```\n\n- projectile: Object\n- subMunitionProjectile: Object\n- position: Array format PositionASL\n- velocity: Array format Vector3D"},{"heading":"Group Event Handlers (Arma 3 v2.10)","level":3,"markdown":"Commands:\n- addEventHandler\n- removeEventHandler\n- removeAllEventHandlers"},{"heading":"CombatModeChanged","level":4,"markdown":"Triggers when the group's **behaviour** changes (see behaviour, setBehaviour)\n\n```sqf\n_group addEventHandler [\"CombatModeChanged\", {\n    params [\"_group\", \"_newMode\"];\n}];\n```\n\n- group: Group\n- newMode: String - see AI Behaviour (**not** Combat Modes!)"},{"heading":"CommandChanged","level":4,"markdown":"```sqf\n_group addEventHandler [\"CommandChanged\", {\n    params [\"_group\", \"_newCommand\"];\n}];\n```\n\n- group: Group\n- newCommand: String, can be one of:\n\n|  |  |\n|---|---|\n| \"NO CMD\" | NoCommand |\n| \"WAIT\" | Wait |\n| \"ATTACK\" | Attack |\n| \"Suppress\" | Suppress |\n| \"HIDE\" | Hide |\n| \"MOVE\" | Move |\n| \"HOOK CARGO\" | HookCargo |\n| \"UNHOOK CARGO\" | UnhookCargo |\n| \"VIV GETIN\" | ViVGetIn |\n| \"VIV GETOUT\" | ViVGetOut |\n| \"VIV UNLOAD\" | ViVUnload |\n| \"HEAL\" | Heal |\n| \"REPAIR\" | Repair |\n| \"REFUEL\" | Refuel |\n| \"REARM\" | Rearm |\n| \"SUPPORT\" | Support |\n| \"JOIN\" | Join |\n| \"GET IN\" | GetIn |\n| \"FIRE\" | Fire |\n| \"GET OUT\" | GetOut |\n| \"STOP\" | Stop |\n| \"EXPECT\" | Expect |\n| \"ACTION\" | Action |\n| \"SCRIPTED\" | Scripted |\n| \"DISMISS\" | Dismiss |\n| \"HEAL SOLDIER\" | HealSoldier |\n| \"PATCH SOLDIER\" | PatchSoldier |\n| \"FIRST AID\" | FirstAid |\n| \"HEAL SELF\" | HealSoldierSelf |\n| \"ATTACK AND FIRE\" | AttackAndFire |\n| \"CARRY SOLDIER\" | CarrySoldier |\n| \"DROP CARRIED\" | DropCarried |\n| \"TAKE BAG\" | TakeBag |\n| \"ASSEMBLE\" | Assemble |\n| \"DISASSEMBLE\" | DisAssemble |\n| \"DROP BAG\" | DropBag |\n| \"OPEN BAG\" | OpenBag |\n| \"IRLASER ON\" | IRLaserOn |\n| \"IRLASER OFF\" | IRLaserOff |\n| \"GUN LIGHT ON\" | GunLightOn |\n| \"GUN LIGHT OFF\" | GunLightOff |\n| \"FIRE AT POSITION\" | FireAtPosition |\n| \"REPAIR VEHICLE\" | RepairVehicle |\n| \"OPEN PARA\" | OpenParachute |\n| \"KEEP DEPTH LEADER\" | KeepDepthLeader |\n| \"KEEP DEPTH UND SURF\" | KeepDepthUnderSurface |\n| \"KEEP DEPTH ABV SURF\" | KeepDepthAboveSurface |\n| \"KEEP DEPTH BOTTOM\" | KeepDepthBottom |\n| \"PUT IN\" | PutIn |\n| \"UNLOAD FROM\" | UnloadFrom |\n| \"USE CONTAINER MAGAZINE\" | UseContainerMagazine |\n| \"ACTIVATE MINE\" | ActivateMine |\n| \"DISABLE MINE\" | DisableMine |"},{"heading":"Deleted (Group)","level":4,"markdown":"```sqf\n_group addEventHandler [\"Deleted\", {\n    params [\"_group\"];\n}];\n```\n\n- group: Group"},{"heading":"Empty","level":4,"markdown":"```sqf\n_group addEventHandler [\"Empty\", {\n    params [\"_group\"];\n}];\n```\n\n- group: Group"},{"heading":"EnableAttackChanged","level":4,"markdown":"```sqf\n_group addEventHandler [\"EnableAttackChanged\", {\n    params [\"_group\", \"_attackEnabled\"];\n}];\n```\n\n- group: Group\n- attackEnabled: Boolean"},{"heading":"EnemyDetected","level":4,"markdown":"```sqf\n_group addEventHandler [\"EnemyDetected\", {\n    params [\"_group\", \"_newTarget\"];\n}];\n```\n\n- group: Group\n- newTarget: Object"},{"heading":"Fleeing","level":4,"markdown":"```sqf\n_group addEventHandler [\"Fleeing\", {\n    params [\"_group\", \"_fleeingNow\"];\n}];\n```\n\n- group: Group\n- fleeingNow: Boolean"},{"heading":"FormationChanged","level":4,"markdown":"```sqf\n_group addEventHandler [\"FormationChanged\", {\n    params [\"_group\", \"_newFormation\"];\n}];\n```\n\n- group: Group\n- newFormation: String - see setFormation"},{"heading":"GroupIdChanged","level":4,"markdown":"```sqf\n_group addEventHandler [\"GroupIdChanged\", {\n    params [\"_group\", \"_newGroupId\"];\n}];\n```\n\n- group: Group\n- newGroupId: String"},{"heading":"KnowsAboutChanged","level":4,"markdown":"```sqf\n_group addEventHandler [\"KnowsAboutChanged\", {\n    params [\"_group\", \"_targetUnit\", \"_newKnowsAbout\", \"_oldKnowsAbout\"];\n}];\n```\n\n- group: Group\n- targetUnit: Object\n- newKnowsAbout: Number\n- oldKnowsAbout: Number"},{"heading":"LeaderChanged","level":4,"markdown":"```sqf\n_group addEventHandler [\"LeaderChanged\", {\n    params [\"_group\", \"_newLeader\"];\n}];\n```\n\n- group: Group\n- newLeader: Object"},{"heading":"Local (Group)","level":4,"markdown":"```sqf\n_group addEventHandler [\"Local\", {\n    params [\"_group\", \"_isLocal\"];\n}];\n```\n\n- group: Group"},{"heading":"SpeedModeChanged","level":4,"markdown":"```sqf\n_group addEventHandler [\"SpeedModeChanged\", {\n    params [\"_group\", \"_newSpeedMode\"];\n}];\n```\n\n- group: Group\n- newSpeedMode: String - see setSpeedMode"},{"heading":"UnitJoined","level":4,"markdown":"```sqf\n_group addEventHandler [\"UnitJoined\", {\n    params [\"_group\", \"_newUnit\"];\n}];\n```\n\n- group: Group\n- newUnit: Object"},{"heading":"UnitKilled (Arma 3 v2.18)","level":4,"markdown":"Local Argument\n\nTriggered when a unit in the group is killed.\n\n```sqf\n_group addEventHandler [\"UnitKilled\", {\n    params [\"_group\", \"_unit\", \"_killer\", \"_instigator\", \"_useEffects\"];\n}];\n```\n\n- group: Group - the group the event handler is assigned to\n- unit: Object - the unit that was killed\n- killer: Object - the object that killed the unit. Contains the unit itself in case of collisions.\n- instigator: Object - the person who pulled the trigger\n- useEffects: Boolean - same as *useEffects* in setDamage alt syntax"},{"heading":"UnitLeft","level":4,"markdown":"```sqf\n_group addEventHandler [\"UnitLeft\", {\n    params [\"_group\", \"_oldUnit\"];\n}];\n```\n\n- group: Group\n- oldUnit: Object"},{"heading":"VehicleAdded","level":4,"markdown":"```sqf\n_group addEventHandler [\"VehicleAdded\", {\n    params [\"_group\", \"_newVehicle\"];\n}];\n```\n\n- group: Group\n- newVehicle: Object"},{"heading":"VehicleRemoved","level":4,"markdown":"```sqf\n_group addEventHandler [\"VehicleRemoved\", {\n    params [\"_group\", \"_oldVehicle\"];\n}];\n```\n\n- group: Group\n- oldVehicle: Object"},{"heading":"WaypointComplete","level":4,"markdown":"```sqf\n_group addEventHandler [\"WaypointComplete\", {\n    params [\"_group\", \"_waypointIndex\"];\n}];\n```\n\n- group: Group\n- waypointIndex: Number"},{"heading":"Game UI Event Handlers","level":3,"markdown":"In Game UI Event Handlers trigger when user scrolls or activates in game action menu.\n\nThe following mission EHs are available in Arma 3:\n- PrevAction - action menu scroll up event\n- Action - action menu action event\n- NextAction - action menu scroll down event\n\n> [!IMPORTANT]\n> Only one event of each kind can exist, adding another will overwrite the existing one.\n\nCommands:\n- inGameUISetEventHandler\n\n> [!NOTE]\n> See Arma 3: Event Handlers/inGameUISetEventHandler."},{"heading":"Control/Display UI Event Handlers","level":3,"markdown":"Commands:\n- ctrlAddEventHandler\n- ctrlRemoveEventHandler\n- ctrlRemoveAllEventHandlers\n- displayAddEventHandler\n- displayRemoveEventHandler\n- displayRemoveAllEventHandlers\n\n> [!NOTE]\n> See User Interface Event Handlers."},{"heading":"Music Event Handlers","level":3,"markdown":"Music event handler, always executed on the computer where it was added.\n\n> [!NOTE]\n> Does not apply to interface-less machines (dedicated server, headless client).\n\nCommands:\n- setMusicEventHandler\n- addMusicEventHandler\n- removeMusicEventHandler\n- removeAllMusicEventHandlers"},{"heading":"MusicStart (Arma 3 v0.50)","level":4,"markdown":"Triggers when CfgMusic sound starts playing, after being executed with playMusic command.\n\n```sqf\naddMusicEventHandler [\"MusicStart\", {\n    params [\"_musicClassname\", \"_eventHandlerID\", \"_currentPosition\", \"_totalLength\"];\n}];\n```\n\n- musicClassName: String - CfgMusic class name of the music that started\n- eventHandlerID: Number - EH id returned by addMusicEventHandler\n- Arma 3 v2.18 currentPosition: Number - current playback position in 0...1 range (see also: getMusicPlayedTime)\n- Arma 3 v2.18 totalLength: Number - track total length in seconds"},{"heading":"MusicStop (Arma 3 v0.50)","level":4,"markdown":"Triggers when CfgMusic sound finished playing, after being executed with playMusic command.\n\nArma 3 v2.14 `playMusic \"\"` triggers this event if a music is currently playing.\n\n```sqf\naddMusicEventHandler [\"MusicStop\", {\n    params [\"_musicClassname\", \"_eventHandlerID\", \"_currentPosition\", \"_totalLength\"];\n}];\n```\n\n- musicClassName: String - CfgMusic class name of the music that stopped\n- eventHandlerID: Number - EH id returned by addMusicEventHandler\n- Arma 3 v2.18 currentPosition: Number - current playback position in 0...1 range (see also: getMusicPlayedTime)\n- Arma 3 v2.18 totalLength: Number - track total length in seconds"},{"heading":"Eden Editor","level":3,"markdown":"Commands:\n- add3DENEventHandler\n- remove3DENEventHandler\n- removeAll3DENEventHandlers\n\n> [!NOTE]\n> See also:\n> - Arma 3: Event Handlers: Eden Editor\n> - its sub-category Object Event Handlers\n> - Eden Editor"},{"heading":"Public Variable Broadcast Event","level":3,"markdown":"Commands:\n- addPublicVariableEventHandler\n\nTriggers when missionNamespace variable EH is associated with is sent over network via publicVariable, publicVariableServer or publicVariableClient commands.\n\n> [!NOTE]\n> Unlike with other types of EHs, there is no way of removing added public variable event handler"},{"heading":"Weapon Muzzle Config Events","level":3,"markdown":"There are six event handlers that can be set on weapon in config. Their parameters are the same as their entity EH equivalents.\n- \"Fired\" - when muzzle fired - see Fired\n- \"Reload\" - before muzzle is reloaded - see MagazineReloading\n- \"Reloaded\" - after muzzle is reloaded - see Reloaded\n- \"MagazineUnloaded\" - when the magazine is removed - see MagazineUnloaded\n- \"WeaponChanged\" - when the weapon is switched to or from - see WeaponChanged\n- \"SlotItemChanged\" - when one of the weapon's attachments is changed - see SlotItemChanged\n\n```cpp\nclass CfgWeapons\n{\n    class RifleCore;\n    class TAG_Rifle : RifleCore\n    {\n        class EventHandlers\n        {\n            fired        = \"systemChat format ['fired weapon EH output: %1 [time: %2]', _this, time]\";\n            reload        = \"systemChat format ['reload weapon EH output: %1 [time: %2]', _this, time]\";\n            reloaded    = \"systemChat format ['reloaded weapon EH output: %1 [time: %2]', _this, time]\";\n            magazineunloaded    = \"systemChat format ['magazineunloaded weapon EH output: %1 [time: %2]', _this, time]\";\n            slotitemchanged    = \"systemChat format ['slotitemchanged weapon EH output: %1 [time: %2]', _this, time]\";\n            weaponchanged    = \"systemChat format ['weaponchanged weapon EH output: %1 [time: %2]', _this, time]\";\n        };\n    };\n};\n```"},{"heading":"Ammo Config Events","level":3,"markdown":"There are three event handlers that can be set on ammo in config:\n- \"init\" - when the ammo is created, by any mean (fired, created, etc). Params: [shot]\n- \"fired\" - when the ammo is fired (legacy). Params: same as in entity EH \"Fired\".\n- \"ammoHit\" - when the ammo hits anything (can trigger multiple times). Params: [shot, shooter, hitobj, pos, velocity, hitComponents, [hit, indirecthit, indirecthitrange, explosive, name], normal, explode, instigator (since Arma 3 v2.18)]\n\n```cpp\nclass CfgAmmo\n{\n    class BulletCore;\n    class TAG_Bullet : BulletCore\n    {\n        class EventHandlers\n        {\n            init    = \"systemChat format ['init ammo EH output: %1 [time: %2]', _this, time]\";\n            fired    = \"systemChat format ['fired ammo EH output: %1 [time: %2]', _this, time]\";\n            ammoHit    = \"systemChat format ['ammoHit EH output: %1 [time: %2]', _this, time]\";\n        };\n    };\n};\n```"},{"heading":"BI Scripted Events","level":3,"markdown":"Commands:\n- BIS_fnc_addScriptedEventHandler\n- BIS_fnc_removeScriptedEventHandler\n- BIS_fnc_removeAllScriptedEventHandlers\n- BIS_fnc_callScriptedEventHandler\n\n> [!NOTE]\n> See also Arma 3: Scripted Event Handlers.\n\nJump to the top of the page"}],"categories":["Event Handlers"],"groups":["Event Handlers"]}