ACE3/addons/movement/functions/fnc_climb.sqf

23 lines
659 B
Plaintext
Raw Normal View History

2015-01-18 05:45:28 +00:00
// by commy2
#include "script_component.hpp"
private "_unit";
_unit = _this select 0;
if !([_unit] call FUNC(canClimb)) exitWith {
[localize "STR_ACE_Movement_CanNotClimb"] call EFUNC(common,displayTextStructured);
};
2015-01-20 01:19:31 +00:00
if !(_unit getVariable [QGVAR(isClimbInit), false]) then {
2015-01-18 05:45:28 +00:00
_unit addEventHandler ["AnimDone", {
if (local (_this select 0) && {_this select 1 == "ACE_Climb"}) then {_this call FUNC(handleClimb)};
}];
2015-01-20 01:19:31 +00:00
_unit setVariable [QGVAR(isClimbInit), true];
2015-01-18 05:45:28 +00:00
};
[_unit] call EFUNC(common,fixLoweredRifleAnimation);
[_unit, "AmovPercMstpSnonWnonDnon", 2] call EFUNC(common,doAnimation);
[_unit, "ACE_Climb", 0] call EFUNC(common,doAnimation);