if Config.ShowNearestGasStationOnly then
Citizen.CreateThread(function()
local currentGasBlip = 0
while true do
local coords = GetEntityCoords(PlayerPedId())
local closest = 1000
local closestCoords
for _, gasStationCoords in pairs(Config.GasStations) do
local dstcheck = GetDistanceBetweenCoords(coords, gasStationCoords)
if dstcheck < closest then
closest = dstcheck
closestCoords = gasStationCoords
end
end
if DoesBlipExist(currentGasBlip) then
RemoveBlip(currentGasBlip)
end
currentGasBlip = CreateBlip(closestCoords)
Citizen.Wait(10000)
end
end)
elseif Config.ShowAllGasStations then
Citizen.CreateThread(function()
for _, gasStationCoords in pairs(Config.GasStations) do
CreateBlip(gasStationCoords)
end
end)
end