rimblock 0 Posted April 14, 2015 So, I think I am doing it wrong. I have a script that will add items from an array in to various eauiped holders on a player (vest, uniform, backpack). The indication that something was amiss was when I dropped the weapon on the floor (along with associated mags) and then could only pickup one of the three mags I had just dropped. The script to add items to the player is not checking for load capacity in the items as I assumed ARMA would do that but it would seem not. WHat commands can be used to verify if enough capacity exists in a weaponholder before adding an item ?. Had a quick search but nothing is coming up as a likely lead based on my search terms. Thanks Share this post Link to post Share on other sites
Schatten 136 Posted April 14, 2015 (edited) _playerUniform = uniform player; _uniformLoad = if (_playerUniform != "") then { // similarly for vests _containerClass = getText (configFile >> "CfgWeapons" >> _playerUniform >> "ItemInfo" >> "containerclass"); _uniformMaxLoad = parseNumber ([_containerClass, "0123456789"] call BIS_fnc_filterString); ceil ((1 - (loadUniform player)) * _uniformMaxLoad); } else {0}; _playerBackpack = backpack player; _backpackLoad = if (_playerBackpack != "") then { _backpackMaxLoad = getNumber (configFile >> "CfgVehicles" >> _playerBackpack >> "maximumload"); ceil ((1 - (loadBackpack player)) * _backpackMaxLoad); } else {0}; _weaponMass = getNumber (configFile >> "CfgWeapons" >> _typeName >> "WeaponSlotsInfo" >> "mass"); if (_weaponMass <= _uniformLoad) then {...} else {if (_weaponMass <= _backpackLoad) then {...} else {...}}; Edited April 14, 2015 by Schatten Share this post Link to post Share on other sites
Larrow 2155 Posted April 14, 2015 These commands may also be useful canAddItemToUniform canAddItemToVest canAddItemToBackpack Share this post Link to post Share on other sites
rimblock 0 Posted April 14, 2015 thanks guys. Will take a look. Share this post Link to post Share on other sites