ACE3/addons/captives/XEH_postInit.sqf

42 lines
1.9 KiB
Plaintext
Raw Normal View History

2015-02-06 09:38:27 +00:00
#include "script_component.hpp"
2016-05-24 13:13:11 +00:00
["ace_settingsInitialized", {
// Hold on a little bit longer to ensure anims will work
[{
GVAR(captivityEnabled) = true;
}, [], 0.05] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addEventHandler;
2015-02-06 09:38:27 +00:00
//Handles when someone starts escorting and then disconnects, leaving the captive attached
//This is normaly handled by the PFEH in doEscortCaptive, but that won't be running if they DC
2015-02-17 00:30:35 +00:00
2015-02-06 09:38:27 +00:00
if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {
2015-08-15 02:29:01 +00:00
params ["_disconnectedPlayer"];
2015-04-16 17:36:12 +00:00
private "_escortedUnit";
2015-02-06 09:38:27 +00:00
_escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull];
if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then {
detach _escortedUnit;
};
if (_disconnectedPlayer getVariable [QGVAR(isEscorting), false]) then {
_disconnectedPlayer setVariable [QGVAR(isEscorting), false, true];
};
}];
};
2016-05-24 13:13:11 +00:00
["ace_playerChanged", {_this call FUNC(handlePlayerChanged)}] call CBA_fnc_addEventHandler;
2016-05-25 18:23:53 +00:00
[QGVAR(moveInCaptive), {_this call FUNC(vehicleCaptiveMoveIn)}] call CBA_fnc_addEventHandler;
[QGVAR(moveOutCaptive), {_this call FUNC(vehicleCaptiveMoveOut)}] call CBA_fnc_addEventHandler;
2015-02-17 00:03:09 +00:00
2016-05-25 18:23:53 +00:00
[QGVAR(setHandcuffed), {_this call FUNC(setHandcuffed)}] call CBA_fnc_addEventHandler;
[QGVAR(setSurrendered), {_this call FUNC(setSurrendered)}] call CBA_fnc_addEventHandler;
2015-09-29 15:17:17 +00:00
//Medical Integration Events
2016-06-03 18:57:21 +00:00
["ace_unconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call CBA_fnc_addEventHandler;
2015-03-15 08:26:16 +00:00
if (!hasInterface) exitWith {};
2015-03-15 15:12:37 +00:00
["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition);
["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition);
["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition);