2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2021-10-12 09:33:05 +00:00
|
|
|
/*
|
2023-08-16 23:18:01 +00:00
|
|
|
* Author: tcvm
|
2021-10-12 09:33:05 +00:00
|
|
|
* Start rope attach PFH
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit wanting to start towing <OBJECT>
|
|
|
|
* 1: Vehicle to tow from <OBJECT>
|
|
|
|
* 2: Rope Classname <STRING>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, cursorObject, "ACE_rope3"] call ace_towing_fnc_startTow
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
params ["_unit", "_target", "_ropeClass"];
|
|
|
|
|
|
|
|
GVAR(attachHelper) = "Sign_Sphere10cm_F" createVehicleLocal [0, 0, 0];
|
|
|
|
[_unit] call EFUNC(weaponselect,putWeaponAway);
|
|
|
|
|
|
|
|
private _ropeLength = getNumber (configFile >> "CfgWeapons" >> _ropeClass >> QEGVAR(logistics_rope,length));
|
|
|
|
if (_ropeLength == 0) then {
|
|
|
|
_ropeLength = 3;
|
|
|
|
};
|
|
|
|
|
|
|
|
_unit removeItem _ropeClass;
|
|
|
|
|
2023-11-11 00:16:11 +00:00
|
|
|
GVAR(isSwimming) = _unit call EFUNC(common,isSwimming);
|
|
|
|
GVAR(putWeaponAwayNextFrame) = false;
|
2021-11-07 23:19:13 +00:00
|
|
|
GVAR(cancel) = false;
|
2021-10-12 09:33:05 +00:00
|
|
|
GVAR(canAttach) = false;
|
|
|
|
[LINKFUNC(towStateMachinePFH), 0, [TOW_STATE_ATTACH_PARENT, _unit, _target, objNull, _ropeLength, _ropeClass]] call CBA_fnc_addPerFrameHandler;
|
2023-05-01 17:39:22 +00:00
|
|
|
[QGVAR(ropeDeployed), [_unit, _target, _ropeClass]] call CBA_fnc_localEvent;
|