Skip to content

Commit

Permalink
Multiple configs test
Browse files Browse the repository at this point in the history
  • Loading branch information
Flohhhhh committed Jan 10, 2023
1 parent 0d0a060 commit 458f63b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions ulc/server/s_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,24 @@ local function LoadExternalVehicleConfig(resourceName)
TriggerEvent("ulc:error", '^1Could not load external configuration; data loaded from: "' .. resourceName .. '" was nil. ^0')
return
end

if CheckData(f(), resourceName) then
print('^2Loaded external configuration for "' .. f().name .. '"^0')
table.insert(Config.Vehicles, f())
else
TriggerEvent("ulc:error", '^1Could not load external configuration for "' .. f().name .. '"^0')

-- NEW STUFF FOR MULTIPLE CONFIGS
local configs = {f()}
for _, v in pairs(configs) do
if CheckData(v, resourceName) then
print('^2Loaded external configuration for "' .. v.name .. '"^0')
table.insert(Config.Vehicles, v)
else
TriggerEvent("ulc:error", '^1Could not load external configuration for "' .. v.name .. '"^0')
end
end

-- if CheckData(f(), resourceName) then
-- print('^2Loaded external configuration for "' .. f().name .. '"^0')
-- table.insert(Config.Vehicles, f())
-- else
-- TriggerEvent("ulc:error", '^1Could not load external configuration for "' .. f().name .. '"^0')
-- end
end

CreateThread(function ()
Expand Down

0 comments on commit 458f63b

Please sign in to comment.