ACE3/addons/fastroping/functions/fnc_cutRopes.sqf

41 lines
1.1 KiB
Plaintext
Raw Normal View History

2015-09-16 21:01:01 +00:00
/*
* Author: BaerMitUmlaut
* Cut deployed ropes.
*
* Arguments:
* 0: A helicopter with deployed ropes <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_vehicle] call ace_fastroping_cutRopes
*
* Public: No
*/
#include "script_component.hpp"
params ["_vehicle"];
private ["_deployedRopes", "_config", "_waitTime"];
2015-09-16 21:01:01 +00:00
_deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
{
2015-09-16 23:26:07 +00:00
_x params ["", "_ropeTop", "_ropeBottom", "_dummy", "_anchor", "_hook"];
2015-09-16 21:01:01 +00:00
deleteVehicle _ropeTop;
2015-09-16 23:26:07 +00:00
[{{deleteVehicle _x} count _this}, [_dummy, _anchor, _ropeBottom, _hook], 60] call EFUNC(common,waitAndExecute);
2015-09-16 21:01:01 +00:00
} count _deployedRopes;
_vehicle setVariable [QGVAR(deployedRopes), [], true];
_vehicle setVariable [QGVAR(deploymentStage), 1, true];
_config = configFile >> "CfgVehicles" >> typeOf _vehicle;
_waitTime = 0;
if (isText (_config >> QGVAR(onCut))) then {
_waitTime = [_vehicle] call (missionNamespace getVariable (getText (_config >> QGVAR(onCut))));
};
[{
_this setVariable [QGVAR(deploymentStage), 0, true];
}, _vehicle, _waitTime] call EFUNC(common,waitAndExecute);