The defendant pleaded guilty to shooting a friend in the head accidentally in 2010 while firing at a rival gang member.