Put the following in the init.sqf of a mission containing a playable soldier and with Respawn available. Then play that mission and hit the respawn button. Note that no message pops up, indicating that the EH never fired from the Respawn Button.
player setVariable ["selections", []];
player setVariable ["gethit", []];
player addEventHandler
[ "HandleDamage",
{
_unit = _this select 0;
_selections = player getVariable ["selections", []];
_gethit = player getVariable ["gethit", []];
_selection = _this select 1;
_projectile = _this select 4;
if !(_selection in _selections) then
{
_selections set [count _selections, _selection];
_gethit set [count _gethit, 0];
};
_i = _selections find _selection;
_olddmg = _gethit select _i;
_curdmg = _this select 2;
if ((_projectile == "") || _curdmg == 1) then {
_curdmg;
player sideChat "Respawn button used!";
}
else
{
player sideChat "NOT Respawn button!";
_newdmg = _olddmg + (_curdmg - _olddmg);
_gethit set [_i, _newdmg];
_newdmg;
};
}
];