A few optimizations.
_weapons = []; THEN agen - _weapons = (getWeaponCargo _object) select 1; Same with _magazines, _backpacks
_weapons THEN use only one time: count _weapons, same with _control,_magazines, _backpacks
use many time (typeOf _object), better use one variable for that: _type
FIX in loop:
one more check old this bag: https://www.youtube.com/watch?v=3ecWX21wEe4
Use this, if you think it's right
The size of control 1001 was shortened in 1.8.7, so it is better to set
it on control 156. The initial text is always blank for that control
when cursorTarget isNull. Showing the weight carried when looking at an
object or vehicle is not necessary. It cuts off with long vehicle names
anyway.