mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Implement Unconc Event Handler
This commit is contained in:
parent
93a1cdaab6
commit
3f32627d61
@ -27,12 +27,5 @@ if (isServer) then {
|
|||||||
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
|
["SetHandcuffed", {_this call FUNC(setHandcuffed)}] call EFUNC(common,addEventHandler);
|
||||||
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
|
["SetSurrendered", {_this call FUNC(setSurrendered)}] call EFUNC(common,addEventHandler);
|
||||||
|
|
||||||
//TODO: Medical Integration Events???
|
//Medical Integration Events???
|
||||||
|
["medical_onUnconscious", {_this call ACE_Captives_fnc_handleOnUnconscious}] call EFUNC(common,addEventHandler);
|
||||||
// [_unit, "knockedOut", {
|
|
||||||
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleKnockedOut};
|
|
||||||
// }] call ACE_Core_fnc_addCustomEventhandler;
|
|
||||||
|
|
||||||
// [_unit, "wokeUp", {
|
|
||||||
// if (local (_this select 0)) then {_this call ACE_Captives_fnc_handleWokeUp};
|
|
||||||
// }] call ACE_Core_fnc_addCustomEventhandler;
|
|
||||||
|
@ -19,10 +19,9 @@ PREP(doUnloadCaptive);
|
|||||||
PREP(handleGetIn);
|
PREP(handleGetIn);
|
||||||
PREP(handleGetOut);
|
PREP(handleGetOut);
|
||||||
PREP(handleKilled);
|
PREP(handleKilled);
|
||||||
PREP(handleKnockedOut);
|
PREP(handleOnUnconscious);
|
||||||
PREP(handlePlayerChanged);
|
PREP(handlePlayerChanged);
|
||||||
PREP(handleUnitInitPost);
|
PREP(handleUnitInitPost);
|
||||||
PREP(handleWokeUp);
|
|
||||||
PREP(handleZeusDisplayChanged);
|
PREP(handleZeusDisplayChanged);
|
||||||
PREP(moduleSurrender);
|
PREP(moduleSurrender);
|
||||||
PREP(setHandcuffed);
|
PREP(setHandcuffed);
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: commy2, PabstMirror
|
|
||||||
* Handles when a unit gets knocked out. Ends surrendering.
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* 0: Unit <OBJECT>
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* Nothing
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* [bob, true] call ACE_captives_fnc_handleKnockedOut
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
//ToDo: Waiting on medical integration
|
|
||||||
|
|
||||||
PARAMS_1(_unit);
|
|
||||||
|
|
||||||
if (_unit getVariable [QGVAR(isSurrendering), false]) then { //If surrendering, stop
|
|
||||||
[_unit, false] call FUNC(setSurrendered);
|
|
||||||
};
|
|
36
addons/captives/functions/fnc_handleOnUnconscious.sqf
Normal file
36
addons/captives/functions/fnc_handleOnUnconscious.sqf
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* Author: commy2, PabstMirror
|
||||||
|
* Handles the "medical_onUnconscious" event
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Unit <OBJECT>
|
||||||
|
* 0: Is Unconsisisiouses <BOOL>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* [bob, true] call ACE_captives_fnc_handleOnUnconscious
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
PARAMS_2(_unit,_isUnconc);
|
||||||
|
|
||||||
|
if (!local _unit) exitWith {};
|
||||||
|
|
||||||
|
systemChat format ["med: %1", _this];
|
||||||
|
|
||||||
|
if (_isUnconc) then {
|
||||||
|
//Knocked out: If surrendering, stop
|
||||||
|
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
|
||||||
|
[_unit, false] call FUNC(setSurrendered);
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
//Woke up: if handcuffed, goto animation
|
||||||
|
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
||||||
|
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
||||||
|
[_unit, "ACE_AmovPercMstpScapWnonDnon", 1] call EFUNC(common,doAnimation);
|
||||||
|
};
|
||||||
|
};
|
@ -1,23 +0,0 @@
|
|||||||
/*
|
|
||||||
* Author: commy2
|
|
||||||
* TODO
|
|
||||||
*
|
|
||||||
* Arguments:
|
|
||||||
* 0: _unit <OBJECT>
|
|
||||||
*
|
|
||||||
* Return Value:
|
|
||||||
* The return value <BOOL>
|
|
||||||
*
|
|
||||||
* Example:
|
|
||||||
* [bob] call ACE_captives_fnc_handleWokeUp
|
|
||||||
*
|
|
||||||
* Public: No
|
|
||||||
*/
|
|
||||||
#include "script_component.hpp"
|
|
||||||
|
|
||||||
PARAMS_1(_unit);
|
|
||||||
|
|
||||||
if (_unit getVariable [QGVAR(isHandcuffed), false] && {vehicle _unit == _unit}) then {
|
|
||||||
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
|
|
||||||
[_unit, "ACE_AmovPercMstpScapWnonDnon", 0] call EFUNC(common,doAnimation);
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user