2018-09-17 19:19:29 +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:
|
|
|
|
* 0: Item Classname <STRING>
|
|
|
|
* 1: Vehicle <OBJECT>
|
|
|
|
* 2: Amount <NUMBER> (default: 1)
|
2015-09-26 22:31:23 +00:00
|
|
|
* 3: Show Hint <BOOL> (default: false)
|
2015-08-18 21:51:30 +00:00
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
2015-08-22 14:45:50 +00:00
|
|
|
* ["item", vehicle] call ace_cargo_fnc_addCargoItem
|
2015-08-18 21:51:30 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2016-01-27 20:56:25 +00:00
|
|
|
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]]];
|
2015-08-18 21:51:30 +00:00
|
|
|
TRACE_3("params",_itemClass,_vehicle,_amount);
|
|
|
|
|
|
|
|
for "_i" from 1 to _amount do {
|
2015-11-20 22:28:52 +00:00
|
|
|
[_itemClass, _vehicle] call FUNC(loadItem);
|
2015-08-18 21:51:30 +00:00
|
|
|
};
|
2015-09-27 16:19:40 +00:00
|
|
|
|
|
|
|
// Invoke listenable event
|
2016-06-24 15:12:19 +00:00
|
|
|
["ace_cargoAdded", [_itemClass, _vehicle, _amount]] call CBA_fnc_globalEvent;
|