ACE3/addons/rearm/functions/fnc_storeAmmo.sqf

41 lines
1.0 KiB
Plaintext
Raw Normal View History

/*
* Author: GitHawk
* Stores ammo in an ammo truck.
*
* Arguments:
2016-02-27 20:05:19 +00:00
* 0: Ammo Truck <OBJECT>
* 1: Unit <OBJECT>
*
* Return Value:
* None
*
* Example:
2016-02-27 20:05:19 +00:00
* [ammo_truck, player] call ace_rearm_fnc_storeAmmo
*
* Public: No
*/
#include "script_component.hpp"
params [
["_truck", objNull, [objNull]],
["_unit", objNull, [objNull]]
];
2016-02-27 20:05:19 +00:00
private _attachedDummy = _unit getVariable [QGVAR(dummy), objNull];
if (isNull _attachedDummy) exitwith {};
[
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);
},
"",
2016-02-27 20:05:19 +00:00
format [localize LSTRING(StoreAmmoAction), getText(configFile >> "CfgMagazines" >> (_attachedDummy getVariable QGVAR(magazineClass)) >> "displayName"), getText(configFile >> "CfgVehicles" >> (typeOf _truck) >> "displayName")],
{true},
["isnotinside"]
] call EFUNC(common,progressBar);