-- it have nothing to do with sql anymore
local vehicle = getPedOccupiedVehicle( player )
if vehicle then
local data = vehicles[ vehicle ]
if data then
if data.impounded == 0 then
elseif data.impounded == 1 then
else
-- error
end
end
i dont know what is in your vehicles variable.
it's very hard to find errors in your code with only part of it, and when it's so big, and we can't test it anyway.
i need to spend sometimes 10 minutes trying to understand what it should do.
maybe it's time to learn debugging?
it will help you many times. it's much faster to do a little debug than waiting days for reply that can't even come at all..
read especially 3.2 and 3.3 part of that wiki page.