A Thai former lawmaker confessed to shooting a senior official at a government office over a money dispute, police have said.