local settings = {
uuid = "123123",
nick = "Liquit",
authenticated = true,
token = "yaloh",
roles = {}
}
local spath = getWorkingDirectory() .. "\\loh\\settings.json"
function main()
while not isSampAvailable() do wait(0) end
if not doesFileExist(spath) then
sampAddChatMessage('Создаю файл с настройками..', -1)
save()
end
table.insert(settings.roles, "admin")
table.insert(settings.roles, "player")
save()
wait(-1)
end
function save()
local f = io.open(spath, "w")
f:write(encodeJson(settings))
f:close()
end