- 232
- 49
- Версия MoonLoader
- .026-beta
Не save нихера
[08:06:07.326637] (exception) cocs: CJSON: Cannot serialise userdata: type not supported
[08:06:07.326637] (error) cocs: C:\Games\GTA 140K\moonloader\cocs.lua:52: bad argument #1 to 'write' (string expected, got nil)
stack traceback:
[C]: in function 'write'
C:\Games\GTA 140K\moonloader\cocs.lua:52: in main chunk
[08:06:07.326637] (error) cocs: Script died due to an error. (0BEADD74)
Lua:
local config = {
gram = {
mess = imgui.ImBool(false),
spam = imgui.ImBool(false),
}
}
if not doesFileExist(path) then
local f = io.open(path, 'w+')
f:write(encodeJson(config)):close()
else
local f = io.open(path, "r")
a = f:read("*a")
config = decodeJson(a)
f:close()
end
function JSONSave()
if doesFileExist(path) then
local f = io.open(path, 'w+')
if f then
f:write(encodeJson(config)):close() --52 строка
return true
else
return false
end
else
return false
end
end