  In this paper we consider two pointsets in $\mathrm{PG}(2,q^n)$ arising from
a linear set $L$ of rank $n$ contained in a line of $\mathrm{PG}(2,q^n)$: the
first one is a linear blocking set of R\'edei type, the second one extends the
construction of translation KM-arcs. We point out that their intersections
pattern with lines is related to the weight distribution of the considered
linear set $L$. We then consider the Hamming metric codes associated with both
these constructions, for which we can completely describe their weight
distributions. By choosing $L$ to be an $\mathbb{F}_q$-linear set with a short
weight distribution, then the associated codes have few weights. We conclude
the paper by providing a connection between the $\Gamma\mathrm{L}$-class of $L$
and the number of inequivalent codes we can construct starting from it.
