2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-09-16 21:01:01 +00:00
|
|
|
/*
|
|
|
|
* Author: BaerMitUmlaut
|
|
|
|
* Lets the unit fast rope.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit occupying the helicopter <OBJECT>
|
|
|
|
* 1: The helicopter itself <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-12-14 20:50:56 +00:00
|
|
|
* [_player, _vehicle] call ace_fastroping_fnc_fastRope
|
2015-09-16 21:01:01 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
params ["_unit", "_vehicle"];
|
2019-01-12 03:05:25 +00:00
|
|
|
TRACE_2("fastRope",_unit,_vehicle);
|
2015-09-16 21:01:01 +00:00
|
|
|
|
|
|
|
//Select unoccupied rope
|
2017-09-19 20:38:49 +00:00
|
|
|
private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
|
|
|
|
private _usableRope = _deployedRopes select 0;
|
|
|
|
private _usableRopeIndex = 0;
|
2015-09-16 21:01:01 +00:00
|
|
|
{
|
2018-04-12 15:23:18 +00:00
|
|
|
if (!(_x select 5) && !(_x select 6)) exitWith {
|
2015-09-16 21:01:01 +00:00
|
|
|
_usableRope = _x;
|
|
|
|
_usableRopeIndex = _forEachIndex;
|
|
|
|
};
|
|
|
|
} forEach _deployedRopes;
|
|
|
|
|
2016-02-21 23:29:15 +00:00
|
|
|
_usableRope set [5, true];
|
2015-09-16 21:01:01 +00:00
|
|
|
_deployedRopes set [_usableRopeIndex, _usableRope];
|
|
|
|
_vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true];
|
|
|
|
|
2015-12-22 07:53:57 +00:00
|
|
|
//Start server PFH asap
|
2016-05-22 15:29:05 +00:00
|
|
|
[QGVAR(startFastRope), [_unit, _vehicle, _usableRope, _usableRopeIndex, false]] call CBA_fnc_serverEvent;
|
2015-09-16 21:01:01 +00:00
|
|
|
moveOut _unit;
|
2024-03-28 18:57:23 +00:00
|
|
|
[LINKFUNC(fastRopeLocalPFH), 0, [_unit, _vehicle, _usableRope, _usableRopeIndex, diag_tickTime]] call CBA_fnc_addPerFrameHandler;
|