mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
30 lines
736 B
Plaintext
30 lines
736 B
Plaintext
|
/*
|
||
|
Name: AGM_Logistics_fnc_loadMagazineRemote
|
||
|
|
||
|
Author:
|
||
|
Garth de Wet (LH)
|
||
|
|
||
|
Description:
|
||
|
Loads the magazine into the vehicle. Is executed on the owner of the vehicle. (setAmmo requirement)
|
||
|
|
||
|
Parameters:
|
||
|
0: OBJECT - vehicle to load
|
||
|
1: STRING - name of magazine to load
|
||
|
|
||
|
Returns:
|
||
|
Nothing
|
||
|
|
||
|
Example:
|
||
|
[AGM_Interaction_Target, "Titan_AA"] call AGM_Logistics_fnc_loadMagazineRemote;
|
||
|
*/
|
||
|
private ["_vehicle", "_magazine", "_weapon"];
|
||
|
_vehicle = _this select 0;
|
||
|
_magazine = _this select 1;
|
||
|
_weapon = _this select 2;
|
||
|
|
||
|
if (getNumber (configFile >> "CfgMagazines" >> _magazine >> "AGM_MagazineReloadType") == 1) then {
|
||
|
_vehicle setAmmo [_weapon, (_vehicle ammo _weapon) + 1];
|
||
|
} else {
|
||
|
_vehicle addMagazineGlobal _magazine;
|
||
|
};
|