ACE3/addons/captives/functions/fnc_handleUnitInitPost.sqf

35 lines
1.0 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-02-04 06:35:51 +00:00
/*
2015-02-06 09:38:27 +00:00
* Author: commy2
* handle captive and unconsciousness state and prevent grenades
*
* Arguments:
* 0: _unit <OBJECT>
*
* Return Value:
* The return value <BOOL>
*
* Example:
2015-02-06 23:03:56 +00:00
* [bob] call ACE_captives_fnc_handleUnitInitPost
2015-02-06 09:38:27 +00:00
*
* Public: No
*/
2015-02-04 06:35:51 +00:00
params ["_unit"];
2015-02-04 06:35:51 +00:00
2015-02-05 22:39:45 +00:00
// prevent players from throwing grenades (added to all units)
2015-08-15 02:29:01 +00:00
// [_unit, "Throw", {systemChat "a"; ((_this select 1) getVariable [QGVAR(isHandcuffed), false]) || {(_this select 1) getVariable [QGVAR(isSurrendering), false]}; true}, {systemChat "b";}] call EFUNC(common,addActionEventhandler);
2015-02-04 06:35:51 +00:00
if (local _unit) then {
// reset status on mission start
2015-02-05 22:39:45 +00:00
if (_unit getVariable [QGVAR(isHandcuffed), false]) then {
_unit setVariable [QGVAR(isHandcuffed), false];
[_unit, true] call FUNC(setHandcuffed);
2015-02-04 06:35:51 +00:00
};
2015-02-06 21:54:26 +00:00
if (_unit getVariable [QGVAR(isSurrendering), false]) then {
_unit setVariable [QGVAR(isSurrendering), false];
2015-02-17 00:03:09 +00:00
[_unit, true] call FUNC(setSurrendered);
2015-02-06 21:54:26 +00:00
};
2015-02-04 06:35:51 +00:00
};