ACE3/addons/overheating/functions/fnc_swapBarrelAssistant.sqf
SilentSpike 108ff4f644 Replace ACE event system calls with CBA counterparts
Regex used:

\[(.+?),(.+?),(.+?)\]\s+call\s+E?FUNC\((common,)?(target|object)Event\)
[$1,$3,$2] call CBA_fnc_targetEvent

E?FUNC\((common,)?(server|global|local)Event\)
CBA_fnc_$2Event

E?FUNC\((common,)?(add|remove)EventHandler\)
CBA_fnc_$2EventHandler
2016-05-22 16:47:39 +01:00

34 lines
932 B
Plaintext

/*
* Author: esteldunedain, Commy2
* Make a unit start swapping the barrel of another unit
*
* Argument:
* 0: Unit initiating the action <OBJECT>
* 1: Unit that has the weapon <OBJECT>
* 2: Weapon <STRING>
*
* Return value:
* None
*
* Example:
* [player, cursorTarget, currentWeapon cursorTarget] call ace_overheating_fnc_swapBarrelAssistant
*
* Public: No
*/
#include "script_component.hpp"
params ["_assistant", "_gunner", "_weapon"];
TRACE_3("params",_assistant,_gunner,_weapon);
// Make the standing player kneel down
if (stance _assistant != "PRONE") then {
[_assistant, "amovpknlmstpsraswrfldnon", 1] call EFUNC(common,doAnimation);
};
// Barrel dismount gesture
playSound "ACE_BarrelSwap";
[3, [_assistant, _gunner, _weapon], {}, {}, (localize LSTRING(SwappingBarrel))] call EFUNC(common,progressBar);
["initiateSwapBarrelAssisted", [_assistant, _gunner, _weapon], _gunner] call CBA_fnc_targetEvent;