ACE3/addons/fastroping/functions/fnc_onCutCommon.sqf

36 lines
956 B
Plaintext
Raw Normal View History

#include "script_component.hpp"
/*
* Author: BaerMitUmlaut
* Function for closing doors and retracting the hook for most vanilla and older Arma helos.
*
* Arguments:
* 0: Helicopter <OBJECT>
*
* Return Value:
* Amount of time to wait before cutting ropes <NUMBER>
*
* Example:
* [_vehicle] call ace_fastroping_fnc_onCutCommon
*
* Public: No
*/
params ["_vehicle"];
2015-12-01 19:48:20 +00:00
private _fries = _vehicle getVariable [QGVAR(FRIES), objNull];
if !(isNull _fries) then {
{_fries animate [_x, 0]} forEach ANIMS_HOOK;
[{
{_this animateDoor [_x, 0]} forEach ANIMS_ANIMATEDOOR;
{_this animate [_x, 0]} forEach ANIMS_ANIMATE;
2016-03-06 18:53:37 +00:00
_this setVariable [QGVAR(doorsLocked), false, true];
}, _vehicle, 2] call CBA_fnc_waitAndExecute;
4
} else {
{_vehicle animateDoor [_x, 0]} forEach ANIMS_ANIMATEDOOR;
{_vehicle animate [_x, 0]} forEach ANIMS_ANIMATE;
2016-03-06 18:53:37 +00:00
_vehicle setVariable [QGVAR(doorsLocked), false, true];
2
};