ACE3/addons/rearm/functions/fnc_storeAmmo.sqf
PabstMirror f35f80ee82 Rearm - Pylon Support and Dynamically Add Supply Actions (#5183)
* Dynamic Add

* Support 1.70 Pylon Loadouts

* Properly handle old compat pbos - Update RHS Compat

* Re-add documentation

* cleanup headers (note from other pr)

* Cleanup

* Fix var spelling
2017-06-08 11:47:52 -05:00

41 lines
1.1 KiB
Plaintext

/*
* Author: GitHawk
* Stores ammo in an ammo truck.
*
* Arguments:
* 0: Ammo Truck <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
* [ammo_truck, player] call ace_rearm_fnc_storeAmmo
*
* Public: No
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull];
if (isNull _attachedDummy) exitwith {};
[
TIME_PROGRESSBAR(5),
[_unit, _truck, _attachedDummy],
{
params ["_args"];
_args params ["_unit", "_truck", "_attachedDummy"];
[_truck, (_attachedDummy getVariable [QGVAR(magazineClass), ""]), true] call FUNC(addMagazineToSupply);
[_unit, true, true] call FUNC(dropAmmo);
},
"",
format [localize LSTRING(StoreAmmoAction), getText(configFile >> "CfgMagazines" >> (_attachedDummy getVariable QGVAR(magazineClass)) >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _truck) >> "displayName")],
{true},
["isnotinside"]
] call EFUNC(common,progressBar);