2015-06-12 21:54:51 +00:00
|
|
|
/*
|
|
|
|
* Author: Rocko, Ruthberg
|
|
|
|
* Deploy tactical ladder
|
|
|
|
*
|
|
|
|
* Arguments:
|
2015-08-07 06:19:15 +00:00
|
|
|
* None
|
2015-06-12 21:54:51 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
2015-08-07 06:19:15 +00:00
|
|
|
* None
|
2015-06-12 21:54:51 +00:00
|
|
|
*
|
|
|
|
* Example:
|
2015-08-07 06:19:15 +00:00
|
|
|
* [] call ace_tacticalladder_fnc_deployTL
|
2015-06-12 21:54:51 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
2015-06-03 18:27:52 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-06-12 21:54:51 +00:00
|
|
|
if ((backpack ACE_player) != "ACE_TacticalLadder_Pack") exitWith {};
|
|
|
|
|
2015-06-12 20:45:41 +00:00
|
|
|
private ["_pos", "_offset", "_ladder"];
|
|
|
|
|
2015-06-03 18:27:52 +00:00
|
|
|
removeBackpack ACE_player;
|
|
|
|
|
|
|
|
_pos = ACE_player modelToWorld [0,0,0];
|
|
|
|
_offset = if ((ACE_player call CBA_fnc_getUnitAnim select 0) == "prone") then { 1 } else {0.8};
|
|
|
|
_pos set [0, (_pos select 0) + (sin (direction ACE_player) * _offset)];
|
|
|
|
_pos set [1, (_pos select 1) + (cos (direction ACE_player) * _offset)];
|
2015-06-12 20:45:41 +00:00
|
|
|
_pos set [2, [ACE_player] call CBA_fnc_realHeight];
|
2015-06-03 18:27:52 +00:00
|
|
|
|
|
|
|
_ladder = "ACE_Tactical_Ladder" createVehicle _pos;
|
|
|
|
_ladder setPos _pos;
|
|
|
|
_ladder setDir (direction ACE_player);
|
2015-06-12 20:45:41 +00:00
|
|
|
|
2015-06-03 18:27:52 +00:00
|
|
|
ACE_player reveal _ladder;
|