Guilty plea from man who shot at police