ACE3/addons/tacticalladder/functions/fnc_deployTL.sqf

38 lines
807 B
Plaintext
Raw Normal View History

/*
* Author: Rocko, Ruthberg
* Deploy tactical ladder
*
* Arguments:
* 0: unit <OBJECT>
*
* Return Value:
2015-08-07 06:19:15 +00:00
* None
*
* Example:
* [_unit] call ace_tacticalladder_fnc_deployTL
*
* Public: No
*/
#include "script_component.hpp"
params ["_unit"];
if (backpack _unit != 'ACE_TacticalLadder_Pack') exitWith {};
removeBackpack _unit;
2015-06-12 20:45:41 +00:00
private ["_pos", "_offset", "_ladder"];
_pos = _unit modelToWorld [0,0,0];
_offset = if ((_unit call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8};
_pos set [0, (_pos select 0) + (sin getDir _unit) * _offset];
_pos set [1, (_pos select 1) + (cos getDir _unit) * _offset];
_pos set [2, [_unit] call CBA_fnc_realHeight];
_ladder = "ACE_TacticalLadder" createVehicle _pos;
_ladder setPos _pos;
_ladder setDir getDir _unit;
2015-06-12 20:45:41 +00:00
_unit reveal _ladder;