How can I check how many buildings are on map from Player X (for example: Player 3 or Player 4).
I dont care about building type^^ just about count
Thanks
function getBuildingCount(player) 	local count = 0 	local objectlist = object(0,"table") 	for _,id in pairs(objectlist) do 		-- only count building types 		if (object(id, "type") < 20) then 			-- only count buildings belonging to the player 			if (object(id, "player") == player) then 				count = count + 1 			end 		end 	end 	return count end