Skip to content

Commit

Permalink
Merge pull request #310 from Jordan2139/main
Browse files Browse the repository at this point in the history
feat: Add export getAllGarages to retrieve garage data from config
  • Loading branch information
GhzGarage authored Nov 9, 2023
2 parents daa6a58 + 6541c52 commit c842b90
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,25 @@ QBCore.Functions.CreateCallback('qb-garages:server:GetPlayerVehicles', function(
end
end)
end)

local function getAllGarages()
local garages = {}
for k, v in pairs(Config.Garages) do
garages[#garages+1] = {
name = k,
label = v.label,
type = v.type,
takeVehicle = v.takeVehicle,
putVehicle = v.putVehicle,
spawnPoint = v.spawnPoint,
showBlip = v.showBlip,
blipName = v.blipName,
blipNumber = v.blipNumber,
blipColor = v.blipColor,
vehicle = v.vehicle
}
end
return garages
end

exports('getAllGarages', getAllGarages)

0 comments on commit c842b90

Please sign in to comment.