Aside from the technical difficulty of designing such a system and making it difficult to bypass, that sounds like a solution in search of a problem. People firing rifles of any kind in urban environments, whether by accident, for self defense or to commit a crime is quite rare. Handguns are the weapon of choice for both criminal use and lawful self defense in cities. I suppose you could disable those too, but the effect on crime would be similar to banning them: criminals would still have working guns and non-criminals wouldn't.