ACE3/addons/overheating/functions/fnc_swapBarrel.sqf

38 lines
1.0 KiB
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-01-16 02:36:31 +00:00
/*
* Author: Commy2
* Make a unit start swapping it's barrel
*
2016-06-18 09:50:41 +00:00
* Arguments:
* 0: Unit initiating the action <OBJECT>
* 1: Unit that has the weapon <OBJECT>
* 2: Weapon <STRING>
2015-01-16 02:36:31 +00:00
*
2016-06-18 09:50:41 +00:00
* Return Value:
2015-01-16 02:36:31 +00:00
* None
2015-02-08 22:54:12 +00:00
*
2015-12-15 07:09:26 +00:00
* Example:
* [cursorTarget, player, currentWeapon player] call ace_overheating_fnc_swapBarrel
2015-12-15 07:09:26 +00:00
*
2015-02-08 22:54:12 +00:00
* Public: No
2015-01-16 02:36:31 +00:00
*/
2015-01-13 03:23:14 +00:00
params ["_assistant", "_gunner", "_weapon"];
TRACE_3("params",_assistant,_gunner,_weapon);
2015-01-13 03:23:14 +00:00
// Make the standing player kneel down
if (stance _gunner != "PRONE") then {
[_gunner, "amovpknlmstpsraswrfldnon", 1] call EFUNC(common,doAnimation);
2015-01-13 03:23:14 +00:00
};
// Barrel dismount gesture
2016-07-12 14:16:01 +00:00
[_gunner, QGVAR(GestureDismountMuzzle)] call EFUNC(common,doGesture);
2015-01-13 03:23:14 +00:00
playSound "ACE_BarrelSwap";
private _duration = 3.0;
if (_assistant isEqualTo _gunner) then {
_duration = 5.0;
};
[_duration, [_assistant,_gunner,_weapon], {(_this select 0) call FUNC(swapBarrelCallback)}, {}, localize LSTRING(SwappingBarrel), nil, ["isNotInside", "isNotSitting", "isNotSwimming"]] call EFUNC(common,progressBar);