2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-20 17:51:22 +00:00
|
|
|
/*
|
|
|
|
* Author: GitHawk
|
|
|
|
* Stores ammo in an ammo truck.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2016-02-27 20:05:19 +00:00
|
|
|
* 0: Ammo Truck <OBJECT>
|
2015-08-20 17:51:22 +00:00
|
|
|
* 1: Unit <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2016-02-27 20:05:19 +00:00
|
|
|
* [ammo_truck, player] call ace_rearm_fnc_storeAmmo
|
2015-08-20 17:51:22 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2017-09-29 19:53:25 +00:00
|
|
|
params ["_truck", "_unit"];
|
2015-08-20 17:51:22 +00:00
|
|
|
|
2016-02-27 20:05:19 +00:00
|
|
|
private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull];
|
|
|
|
if (isNull _attachedDummy) exitwith {};
|
2015-08-20 17:51:22 +00:00
|
|
|
|
2019-01-31 00:31:01 +00:00
|
|
|
private _magazineClass = _attachedDummy getVariable [QGVAR(magazineClass), "#noVar"];
|
|
|
|
|
2015-08-20 17:51:22 +00:00
|
|
|
[
|
2017-06-08 16:47:52 +00:00
|
|
|
TIME_PROGRESSBAR(5),
|
2016-02-27 20:05:19 +00:00
|
|
|
[_unit, _truck, _attachedDummy],
|
2016-02-27 19:31:07 +00:00
|
|
|
{
|
|
|
|
params ["_args"];
|
2016-02-27 20:05:19 +00:00
|
|
|
_args params ["_unit", "_truck", "_attachedDummy"];
|
|
|
|
[_truck, (_attachedDummy getVariable [QGVAR(magazineClass), ""]), true] call FUNC(addMagazineToSupply);
|
2016-02-27 19:31:07 +00:00
|
|
|
[_unit, true, true] call FUNC(dropAmmo);
|
|
|
|
},
|
2015-08-20 17:51:22 +00:00
|
|
|
"",
|
2021-02-18 18:58:08 +00:00
|
|
|
format [localize LSTRING(StoreAmmoAction), _magazineClass call FUNC(getMagazineName), getText(configOf _truck >> "displayName")],
|
2015-08-20 17:51:22 +00:00
|
|
|
{true},
|
|
|
|
["isnotinside"]
|
|
|
|
] call EFUNC(common,progressBar);
|