peasant_huts_n = 0 for i,hut in GetObjectNamesByType("PEASANT_HUT") do if GetObjectOwner(hut) == 2 then peasant_huts_n = peasant_huts_n + 1 end end