GMOD_disease/lua/autorun/server/sv_config.lua
2023-09-03 20:04:49 +02:00

24 lines
557 B
Lua

utils = include("sv_utils.lua")
config = include("../sh_config.lua")
local dirs = utils.split(config.config_path, "/")
table.remove(dirs)
local tmp = "";
for i, dir in ipairs(dirs) do
tmp = tmp .. dir
if not file.Exists(tmp, "DATA")
then
print(tmp)
file.CreateDir(tmp)
end
tmp = tmp .. "/"
end
if not file.Exists(config.config_path, "DATA")
then
print(config.config_path)
local default_config = {}
default_config.diseases = {}
file.Write(config.config_path, util.TableToJSON(default_config, true))
end