What do you do about all the lost ticket revenue when you stop having traffic violations?
Downsize the department and let the cops that are let go do something productive.
How do police react when they lose the ability to use a traffic stop as an excuse to find drugs in cars?
Not harass as many people.
How do you fund roads with a gas tax when cars become more fuel efficient and eventually switch to electricity (often generated at home with solar panels)?
Use other taxes. Granted, all of these solutions may be poorly received by some people, but they are very clearly the correct answer to all of these questions.