mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
remoteFncs -> events
This commit is contained in:
parent
4156143ecf
commit
4c727fbff5
@ -6,7 +6,7 @@ class CfgVehicles {
|
|||||||
displayName = "$STR_ACE_Captives_SetCaptive";
|
displayName = "$STR_ACE_Captives_SetCaptive";
|
||||||
distance = 4;
|
distance = 4;
|
||||||
condition = QUOTE(('ACE_CableTie' in (items _player)) && {alive _target} && {!(_target getVariable ['ACE_isCaptive', false])});
|
condition = QUOTE(('ACE_CableTie' in (items _player)) && {alive _target} && {!(_target getVariable ['ACE_isCaptive', false])});
|
||||||
statement = QUOTE(_player removeItem 'ACE_CableTie'; [ARR_2(_target, true)] call FUNC(setCaptive););
|
statement = QUOTE(_player removeItem 'ACE_CableTie'; [ARR_3(QGVAR(SetCaptive), [_target], [ARR_2(_target, true)])] call EFUNC(common,targetEvent););
|
||||||
showDisabled = 0;
|
showDisabled = 0;
|
||||||
priority = 2.4;
|
priority = 2.4;
|
||||||
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
|
icon = QUOTE(PATHTOF(UI\handcuff_ca.paa));
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
// by commy2
|
// by commy2
|
||||||
|
|
||||||
[missionNamespace, "playerChanged", {_this call ACE_Captives_fnc_handlePlayerChanged}] call ACE_Core_fnc_addCustomEventhandler;
|
[missionNamespace, "playerChanged", {_this call ACE_Captives_fnc_handlePlayerChanged}] call ACE_Core_fnc_addCustomEventhandler;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[QGVAR(MoveIn), {_this call FUNC(vehicleCaptiveMoveIn)}] call EFUNC(common,addEventHandler);
|
||||||
|
[QGVAR(MoveOut), {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
|
||||||
|
[QGVAR(SetCaptive), {_this call FUNC(vehicleCaptiveMoveOut)}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -20,9 +20,9 @@
|
|||||||
PARAMS_1(_unit,_target,_vehicle);
|
PARAMS_1(_unit,_target,_vehicle);
|
||||||
|
|
||||||
if (isNull _target) then {
|
if (isNull _target) then {
|
||||||
// _objects = attachedObjects _unit;
|
_objects = attachedObjects _unit;
|
||||||
// _objects = [_objects, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
|
_objects = [_objects, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
|
||||||
// _target = _objects select 0;
|
_target = _objects select 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (isNull _vehicle) then {
|
if (isNull _vehicle) then {
|
||||||
@ -30,7 +30,7 @@ if (isNull _vehicle) then {
|
|||||||
_vehicle = _objects select 0;
|
_vehicle = _objects select 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!isNil "_target" && {!isNil "_vehicle"}) then {
|
if ((!isNil "_target") && {!isNil "_vehicle"}) then {
|
||||||
_unit setVariable ["ACE_isEscorting", false];
|
_unit setVariable ["ACE_isEscorting", false];
|
||||||
[[_target, _vehicle], "{(_this select 0) moveInCargo (_this select 1); (_this select 0) assignAsCargo (_this select 1); (_this select 0) setVariable ['ACE_Captives_CargoIndex', (_this select 1) getCargoIndex (_this select 0), true];}", _target] call ACE_Core_fnc_execRemoteFnc;
|
[QGVAR(MoveIn), [_target], [_target, _vehicle]] call EFUNC(common,targetEvent);
|
||||||
};
|
};
|
||||||
|
@ -24,12 +24,9 @@ _cargo = crew _vehicle; // Can also unload from driver, gunner, commander, turr
|
|||||||
|
|
||||||
_cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
|
_cargo = [_cargo, {_this getVariable ["ACE_isCaptive", false]}] call EFUNC(common,filter);
|
||||||
|
|
||||||
if (count _cargo > 0) then {
|
if ((count _cargo) > 0) then {
|
||||||
_target = _cargo select 0;
|
_target = _cargo select 0;
|
||||||
|
[QGVAR(MoveOut), [_target], [_target]] call EFUNC(common,targetEvent);
|
||||||
_target setVariable ["ACE_Captives_CargoIndex", -1, true];
|
} else {
|
||||||
|
ERROR("No captive to unload");
|
||||||
moveOut _target;
|
|
||||||
[_target, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
|
|
||||||
[_target, "{unassignVehicle _this}", _target] call ACE_Core_fnc_execRemoteFnc;
|
|
||||||
};
|
};
|
||||||
|
28
addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf
Normal file
28
addons/captives/functions/fnc_vehicleCaptiveMoveIn.sqf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
* Loads a captive into a vehicle
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: The Captive <OBJECT>
|
||||||
|
* 1: The Vehicle <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* TODO
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
PARAMS_2(_target,_vehicle);
|
||||||
|
|
||||||
|
private ["_cargoIndex"];
|
||||||
|
|
||||||
|
_target moveInCargo _vehicle;
|
||||||
|
_target assignAsCargo _vehicle;
|
||||||
|
_cargoIndex = _vehicle getCargoIndex _target;
|
||||||
|
_target setVariable ["ACE_Captives_CargoIndex", _cargoIndex, true];
|
||||||
|
|
||||||
|
TRACE_3("moveinEH",_target,_vehicle,_cargoIndex);
|
24
addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf
Normal file
24
addons/captives/functions/fnc_vehicleCaptiveMoveOut.sqf
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
/*
|
||||||
|
* Author: PabstMirror
|
||||||
|
* Unloads a captive from a vehicle.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* 0: Captive Unit being unloaded <OBJECT>
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* Nothing
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* TODO
|
||||||
|
*
|
||||||
|
* Public: No
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
PARAMS_1(_unit);
|
||||||
|
|
||||||
|
_unit setVariable ["ACE_Captives_CargoIndex", -1, true];
|
||||||
|
|
||||||
|
moveOut _unit;
|
||||||
|
[_unit, "ACE_AmovPercMstpScapWnonDnon", 2] call EFUNC(common,doAnimation);
|
||||||
|
unassignVehicle _unit;
|
Loading…
Reference in New Issue
Block a user