That would still leave the problem if determining what state they were driving in, or allocating all the revenue to their state of residence even when they drive in other states as well.
How this works in trucking is interesting. Whenever a truck fills up its tank, the driver pays the gas tax in that state. They then track how many miles they drive in each state, and then quarterly have to "correct" their gas tax by paying the states where they drive more miles than they paid taxes for and get refunded by states where they fueled but didn't drive as many miles. Trucks these days have automated systems for tracking all this.
If you are interested, this is part of IFTA, the International Fuel Tax Agreement.