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
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-09-26 22:31:23 +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
|
|
|
|
["cargoAddedByClass", [_itemClass, _vehicle, _amount]] call EFUNC(common,globalEvent);
|