ACE3/addons/cargo/functions/fnc_getSizeItem.sqf

26 lines
559 B
Plaintext
Raw Normal View History

#include "..\script_component.hpp"
2015-08-10 21:07:47 +00:00
/*
* Author: Glowbal, kymckay
* Gets the cargo size of an object.
2015-08-10 21:07:47 +00:00
*
* Arguments:
* 0: Item <STRING> or <OBJECT>
2015-08-10 21:07:47 +00:00
*
2016-06-18 09:50:41 +00:00
* Return Value:
2015-08-16 20:41:35 +00:00
* Cargo size <NUMBER> (default: -1)
*
* Example:
* cursorObject call ace_cargo_fnc_getSizeItem
2015-08-10 21:07:47 +00:00
*
* Public: No
*/
2015-08-14 16:42:22 +00:00
params ["_item"];
2016-01-19 03:53:48 +00:00
// Default cargo size is -1 as 0 is a valid size
if (_item isEqualType "") then {
GET_NUMBER(configFile >> "CfgVehicles" >> _item >> QGVAR(size),-1)
} else {
_item getVariable [QGVAR(size), GET_NUMBER(configOf _item >> QGVAR(size),-1)]
2015-08-10 21:07:47 +00:00
};