ACE3/addons/cargo/functions/fnc_getSizeItem.sqf

29 lines
477 B
Plaintext
Raw Normal View History

2015-08-10 21:07:47 +00:00
/*
* Author: Glowbal
2015-08-16 20:41:35 +00:00
* Get the cargo size of an object.
2015-08-10 21:07:47 +00:00
*
* Arguments:
* 0: Object <OBJECT>
*
* Return value:
2015-08-16 20:41:35 +00:00
* Cargo size <NUMBER> (default: -1)
*
* Example:
* [object] call ace_cargo_fnc_getSizeItem
2015-08-10 21:07:47 +00:00
*
* Public: No
*/
#include "script_component.hpp"
2015-08-14 16:42:22 +00:00
private "_config";
2015-08-16 20:41:35 +00:00
2015-08-14 16:42:22 +00:00
params ["_item"];
2015-08-16 20:41:35 +00:00
_config = (configFile >> "CfgVehicles" >> typeof _item >> QGVAR(size));
2015-08-16 20:41:35 +00:00
if (isNumber (_config)) exitWith {
_item getVariable [QGVAR(size), getNumber (_config)]
2015-08-10 21:07:47 +00:00
};
2015-08-16 20:41:35 +00:00
-1