Difference between revisions of "DCS func addEventHandler"

From DCS World Wiki - Hoggitworld.com
 
Line 5: Line 5:
 
|fName= addEventHandler
 
|fName= addEventHandler
  
|vNum= 1.2.4
+
|vNum= 1.2.0
  
 
|par1= [[DCS_singleton_world|world]]
 
|par1= [[DCS_singleton_world|world]]
Line 56: Line 56:
 
[[Category:Events|addEventHandler]]
 
[[Category:Events|addEventHandler]]
 
[[Category:Singleton Functions|addEventHandler]]
 
[[Category:Singleton Functions|addEventHandler]]
 +
[[Category:Game Patch 1.2.0|addEventHandler]]

Revision as of 06:58, 17 March 2022

Scripting Root

Envrioment: Mission Scripting
Function: addEventHandler Added with: 1.2.0
Member Of: world
Syntax: function world.addEventHandler(EventHandler handler )
Description: Adds a function as an event handler that executes whenever a simulator event occurs. The most common uses of event handlers are to track statistics of units within a given scenario and to execute code based on certain events occurring. Handlers are passed event tables which contains numerous data regarding the event.

For examples of the event tables returned, reference the event page on the wiki to get more information regarding the event.

Event Types: shot, hit, takeoff, land, crash, ejection, refueling, dead, pilot_dead, base_captured, mission_start, mission_end, took_control, refueling_stop, birth, human_failure, detailed_failure, engine_startup, engine_shutdown, player_enter_unit, player_leave_unit, player_comment, shooting_start, shooting_end, mark_added, mark_change, mark_remove, kill, score, unit_lost, landing_after_ejection, discard_chair_after_ejection, weapon_add, landing_quality_mark, ai_abort_mission, weapon_drop


Return Value: function
Return Example:
Examples:
Related Functions: World Functions: addEventHandler, removeEventHandler, getPlayer, getAirbases, searchObjects, getMarkPanels, removeJunk
Notes: