2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-08-18 21:51:30 +00:00
|
|
|
/*
|
|
|
|
* Author: Glowbal, Jonpas
|
|
|
|
* Adds a cargo item to the vehicle.
|
|
|
|
*
|
|
|
|
* Arguments:
|
2023-11-17 23:07:28 +00:00
|
|
|
* 0: Item to be loaded <STRING> or <OBJECT>
|
|
|
|
* 1: Holder object (vehicle) <OBJECT>
|
2015-08-18 21:51:30 +00:00
|
|
|
* 2: Amount <NUMBER> (default: 1)
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2023-11-17 23:07:28 +00:00
|
|
|
* ["ACE_Wheel", cursorObject] call ace_cargo_fnc_addCargoItem
|
2015-08-18 21:51:30 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2023-11-17 23:07:28 +00:00
|
|
|
params ["_item", "_vehicle", ["_amount", 1]];
|
|
|
|
TRACE_3("params",_item,_vehicle,_amount);
|
2015-08-18 21:51:30 +00:00
|
|
|
|
2023-11-17 23:07:28 +00:00
|
|
|
// Get config sensitive case name
|
|
|
|
if (_item isEqualType "") then {
|
|
|
|
_item = _item call EFUNC(common,getConfigName);
|
|
|
|
|
|
|
|
for "_i" from 1 to _amount do {
|
|
|
|
[_item, _vehicle] call FUNC(loadItem);
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
[_item, _vehicle] call FUNC(loadItem);
|
|
|
|
|
|
|
|
_item = typeOf _item;
|
2015-08-18 21:51:30 +00:00
|
|
|
};
|
2015-09-27 16:19:40 +00:00
|
|
|
|
|
|
|
// Invoke listenable event
|
2023-11-17 23:07:28 +00:00
|
|
|
["ace_cargoAdded", [_item, _vehicle, _amount]] call CBA_fnc_globalEvent;
|