Aebian 18 Posted November 2, 2014 Hi, I try to get a EventHandler working. I wanna select the shooter that fired at me. I'm using currently this but its not working: _knight addeventhandler [{hit},{["_knight, _shooter, ]} hint "_shooter"] How I do this? The Biki and 1 hour of google.ca use didn't bring up the right answer =/ Share this post Link to post Share on other sites
opusfmspol 282 Posted November 2, 2014 I would think event handler HandleDamage would identify the source unit as "select 3". https://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#HandleDamage Share this post Link to post Share on other sites
f2k sel 164 Posted November 2, 2014 (edited) simple who shot _knight addeventhandler ["hit",{hint format ["shooter %1",(_this select 1)]}] ; full info _knight addeventhandler ["hit",{hint format ["Hit : %1\n shooter : %2\n Damage : %3",(_this select 0),(_this select 1),(_this select 2)]}] If you ever need to see what info the EVH returns just use hint str _this and then use (_this select xx) where xx points to the element of the array you wish to use _knight addeventhandler ["hit",{hint str _this}]; Edited November 2, 2014 by F2k Sel Share this post Link to post Share on other sites
Aebian 18 Posted November 2, 2014 Thanks for the help. Your first code worked. Nut is there a way to use the shooter for future arguments? I wanna do something with the shooter if the shoot at me. Share this post Link to post Share on other sites
KiloSwiss 16 Posted November 3, 2014 https://community.bistudio.com/wiki/ArmA_2:_Event_Handlers#Hit Passed array: [unit, causedBy, damage] _knight addEventHandler["hit",{_this execVM "someFile.sqf"}]; scriptName "someFile.sqf"; private["_shooter"]; _shooter = _this select 1; /* YOUR CODE HERE */ or _knight addEventHandler["hit",{_this call someVar}]; _knight addEventHandler["hit",{_this spawn someVar}]; someVar = { private["_shooter"]; _shooter = _this select 1; /* YOUR CODE HERE */ }; Greez KiloSwiss Share this post Link to post Share on other sites