ACE3/optionals/compat_rhs_usf3/functions/fnc_onPrepare.sqf
magicsh0tz cd852477c8 CH53 Fastroping and other fixes (#4713)
* CH53 Fastroping and Fixes

Added fastrope points for CH53.

The getOut EH is required to keep the doors open when a unit exits the
vehicle and it uses the vehicle animation "doorHandler_R" or
"doorHandler_L" as a placeholder to determine if the doors are
open(1)/close(0).
eg. In UH1Y (Unarmed), when the right door is opened using the
useraction, "doorRB" and "doorHandler_R" will be set to 1.

* Changed TAB to 4 spaces

* Moved bracket to follow guidelines
2017-05-29 12:55:53 -05:00

42 lines
1002 B
Plaintext

/*
* Author: BaerMitUmlaut
* Function for opening doors and extending the hook for most vanilla helos.
*
* Arguments:
* 0: Helicopter <OBJECT>
*
* Return Value:
* Amount of time to wait before deploying ropes <NUMBER>
*
* Example:
* [_vehicle] call ace_compat_rhs_usf3_fnc_onPrepare
*
* Public: No
*/
#include "script_component.hpp"
params ["_vehicle"];
_vehicle setVariable [QEGVAR(fastroping,doorsLocked), true, true];
private _waitTime = 2;
_vehicle animateDoor ["doorRB", 1];
_vehicle animateDoor ["doorLB", 1];
_vehicle animate ["doorHandler_R",1];
_vehicle animate ["doorHandler_L",1];
_vehicle animateDoor ["ramp_anim", 1];
_vehicle animate ["ramp_bottom",0.56];
_vehicle animate ["ramp_top",1];
private _fries = _vehicle getVariable [QEGVAR(fastroping,FRIES), objNull];
if !(isNull _fries) then {
[{
_this animate ["extendHookRight", 1];
_this animate ["extendHookLeft", 1];
}, _fries, 2] call CBA_fnc_waitAndExecute;
_waitTime = 4;
};
_waitTime