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>
|
|
|
|
* 1: Vehicle to be armed <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [ammo_truck, player, ["500Rnd_127x99_mag_Tracer_Red", tank]] call ace_rearm_fnc_takeAmmo
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-05-12 12:55:40 +00:00
|
|
|
params [
|
|
|
|
["_truck", objNull, [objNull]],
|
|
|
|
["_unit", objNull, [objNull]],
|
|
|
|
["_args", ["", objNull], [[]]]
|
|
|
|
];
|
2015-08-20 17:51:22 +00:00
|
|
|
_args params ["_magazineClass", "_vehicle"];
|
|
|
|
|
2016-02-27 19:31:07 +00:00
|
|
|
([_magazineClass] call FUNC(getCaliber)) params ["_cal", "_idx"];
|
2015-08-20 17:51:22 +00:00
|
|
|
|
|
|
|
REARM_HOLSTER_WEAPON
|
|
|
|
|
|
|
|
[
|
|
|
|
(REARM_DURATION_TAKE select _idx),
|
2016-02-27 20:05:19 +00:00
|
|
|
[_unit, _magazineClass, _truck],
|
2015-08-20 17:51:22 +00:00
|
|
|
FUNC(takeSuccess),
|
|
|
|
"",
|
|
|
|
format [localize LSTRING(TakeAction), getText(configFile >> "CfgMagazines" >> _magazineClass >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _vehicle) >> "displayName")],
|
|
|
|
{true},
|
|
|
|
["isnotinside"]
|
|
|
|
] call EFUNC(common,progressBar);
|