GMOD_disease/lua/autorun/server/sv_config.lua

22 lines
508 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
file.CreateDir(tmp)
end
tmp = tmp .. "/"
end
if not file.Exists(config.config_path, "DATA")
then
local default_config = {}
default_config.diseases = {}
file.Write(config.config_path, util.TableToJSON(default_config, true))
end