A federal judge has sentenced a South Texas man to seven years in prison for taking part in a scheme to illegally buy firearms.