A convicted felon who shot and killed two men he said were trying to rob his Spartanburg apartment has pleaded guilty to a federal weapons charge.