GMOD_disease/lua/autorun/server/sv_config.lua

22 lines
508 B
Lua
Raw Normal View History

2023-09-03 14:04:49 -04:00
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