2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-08-20 17:51:22 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
|
|
|
* Starts progress bar for picking up a specific kind of magazine from an ammo truck.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Ammo Truck <OBJECT>
|
|
|
|
* 1: Unit <OBJECT>
|
|
|
|
* 2: Params <ARRAY>
|
|
|
|
* 0: Magazine Classname <STRING>
|
2019-07-05 22:57:22 +00:00
|
|
|
* 1: Vehicle to be armed or player <OBJECT>
|
2015-08-20 17:51:22 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [ammo_truck, player, ["500Rnd_127x99_mag_Tracer_Red", tank]] call ace_rearm_fnc_takeAmmo
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2017-09-29 19:53:25 +00:00
|
|
|
params ["_truck", "_unit", "_args"];
|
2015-08-20 17:51:22 +00:00
|
|
|
_args params ["_magazineClass", "_vehicle"];
|
2017-06-08 16:47:52 +00:00
|
|
|
TRACE_5("takeAmmo",_truck,_unit,_args,_magazineClass,_vehicle);
|
2015-08-20 17:51:22 +00:00
|
|
|
|
2016-02-27 19:31:07 +00:00
|
|
|
([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"];
|
2015-08-20 17:51:22 +00:00
|
|
|
|
2017-05-18 16:13:31 +00:00
|
|
|
REARM_HOLSTER_WEAPON;
|
2015-08-20 17:51:22 +00:00
|
|
|
|
2019-07-05 22:57:22 +00:00
|
|
|
private _targetName = if (_vehicle == _unit) then {
|
|
|
|
"CSW"
|
|
|
|
} else {
|
2021-02-18 18:58:08 +00:00
|
|
|
getText(configOf _vehicle >> "displayName")
|
2019-07-05 22:57:22 +00:00
|
|
|
};
|
|
|
|
|
2015-08-20 17:51:22 +00:00
|
|
|
[
|
2017-06-08 16:47:52 +00:00
|
|
|
TIME_PROGRESSBAR(REARM_DURATION_TAKE select _idx),
|
2019-07-05 22:57:22 +00:00
|
|
|
[_unit, _magazineClass, _truck, _vehicle],
|
2015-08-20 17:51:22 +00:00
|
|
|
FUNC(takeSuccess),
|
|
|
|
"",
|
2019-07-05 22:57:22 +00:00
|
|
|
format [localize LSTRING(TakeAction), _magazineClass call FUNC(getMagazineName), _targetName],
|
2015-08-20 17:51:22 +00:00
|
|
|
{true},
|
|
|
|
["isnotinside"]
|
|
|
|
] call EFUNC(common,progressBar);
|