1 2 3 4 5 6 7 8 9 10 11 12 13
Private["_side","_sideID","_totalSupply"]; _side = _this; _sideID = _side Call GetSideID; _totalSupply = 0; { if ((_x getVariable "sideID") == _sideID) then { _totalSupply = _totalSupply + (_x getVariable "supplyValue"); }; } forEach towns; _totalSupply