From 496fd2183059f37bcfaf14bf6f75166ebc25eef3 Mon Sep 17 00:00:00 2001 From: IndigoFox Date: Tue, 20 Feb 2024 19:51:51 -0800 Subject: [PATCH] adds static line jump 5s invincibility --- .../client/functions/fn_bindEventHandlers.sqf | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/framework/client/functions/fn_bindEventHandlers.sqf b/framework/client/functions/fn_bindEventHandlers.sqf index 15bc941..6d03e93 100644 --- a/framework/client/functions/fn_bindEventHandlers.sqf +++ b/framework/client/functions/fn_bindEventHandlers.sqf @@ -27,6 +27,23 @@ if ( !hasInterface ) exitWith {}; }] call CBA_fnc_addEventHandler; +// Add GetOutMan event handler to grant temporary invincibility to players ejecting from vehicles +// Only for players who have "hooked up" using VS static line +// and are ejecting from a plane or helicopter above 100m +player addEventHandler ["GetOutMan", { + params ["_unit", "_role", "_vehicle", "_turret", "_isEject"]; + if (!isEject) exitWith {}; + if (isNil {_unit getVariable "VS_Jump"}) exitWith {}; + if ( + not (_vehicle isKindOf "Plane" || _vehicle isKindOf "Helicopter") || + ((getPosATL _vehicle)#2) < 100 + ) exitWith {}; + + _unit allowDamage false; + [{_this allowDamage true}, _unit, 5] call CBA_fnc_waitAndExecute; +}]; + + [ { params ["_unit", "_object", "_cost"];