ACE3/addons/fastroping/functions/fnc_fastRope.sqf
pokertour 4a5b5113cd FastRoping - Add rope items which deploy at lengths (#6498)
* Update stringtable.xml

* Update config.cpp

* New CFGWeapon

* Update CfgVehicles.hpp

* Update fnc_deployRopes.sqf

* Update CfgVehicles.hpp

* Update CfgWeapons.hpp

* Update CfgVehicles.hpp

cheapest check before others

* Update fnc_deployRopes.sqf

Corrected the double remove.

* Cleanup PR

Add setting, move rope len to config, simplify strings, add rope image, fix rope unwind length

* Add setting name to stringtable

* Update stringtable.xml

French translation for settings
2019-01-11 21:05:25 -06:00

40 lines
1.1 KiB
Plaintext

#include "script_component.hpp"
/*
* Author: BaerMitUmlaut
* Lets the unit fast rope.
*
* Arguments:
* 0: Unit occupying the helicopter <OBJECT>
* 1: The helicopter itself <OBJECT>
*
* Return Value:
* None
*
* Example:
* [_player, _vehicle] call ace_fastroping_fnc_fastRope
*
* Public: No
*/
params ["_unit", "_vehicle"];
TRACE_2("fastRope",_unit,_vehicle);
//Select unoccupied rope
private _deployedRopes = _vehicle getVariable [QGVAR(deployedRopes), []];
private _usableRope = _deployedRopes select 0;
private _usableRopeIndex = 0;
{
if (!(_x select 5) && !(_x select 6)) exitWith {
_usableRope = _x;
_usableRopeIndex = _forEachIndex;
};
} forEach _deployedRopes;
_usableRope set [5, true];
_deployedRopes set [_usableRopeIndex, _usableRope];
_vehicle setVariable [QGVAR(deployedRopes), _deployedRopes, true];
//Start server PFH asap
[QGVAR(startFastRope), [_unit, _vehicle, _usableRope, _usableRopeIndex, false]] call CBA_fnc_serverEvent;
moveOut _unit;
[FUNC(fastRopeLocalPFH), 0, [_unit, _vehicle, _usableRope, _usableRopeIndex, diag_tickTime]] call CBA_fnc_addPerFrameHandler;