- 1,471
- 435
- Версия MoonLoader
- .025-beta
В скрипте если нет папка или в ней файла ini они создаются кодом. Но вот проблема если их нет и они создаются скрипт ломается, а если они уже были созданы прошлой активацией то всё норм.
(Все операции в которых идёт связь с этим файлом ini идёт после кода создании файлов)
[ML] (error) SMIHelper.lua: C:\Games\GTA San Andreas\moonloader\SMIHelper.lua:183: attempt to index upvalue 'mainIni' (a nil value)
[ML] (error) SMIHelper.lua: Script died due to error. (01ACF954)
(Все операции в которых идёт связь с этим файлом ini идёт после кода создании файлов)
Lua:
if not doesDirectoryExist("moonloader\\SMIHelper")
then
createDirectory("moonloader\\SMIHelper")
end
if not doesFileExist("moonloader\\SMIHelper\\SMIHelper.ini")
then
file = io.open("moonloader\\SMIHelper\\SMIHelper.ini", "a")
file:write("[command]\n")
file:write("menu=sh\n")
file:write("sobes=sob\n")
file:write("efir=ef\n")
file:write("exam=exam\n")
file:write("setting=set\n")
file:write("funct=fun\n")
file:write("[setting]\n")
file:write("name=\n")
file:write("rank=\n")
file:write("city=\n")
file:write("city_mini=\n")
file:write("FM_1=\n")
file:write("FM_2=\n")
file:write("FM_3=\n")
file:write("FM_4=\n")
file:write("FM_5=\n")
file:write("type_nickname=0\n")
file:write("auto_invite=true\n")
file:write("find=true\n")
file:write("prize_1=\n")
file:write("prize_2=\n")
file:write("[/vr]\n")
file:write("text=\n")
file:write("save_text=\n")
file:write("time=1\n")
file:write("[/ad]\n")
file:write("text=\n")
file:write("save_text=\n")
file:write("time=1\n")
file:write("type=0\n")
file:write("[/s]\n")
file:write("text=\n")
file:write("save_text=\n")
file:write("time=1\n")
file:write("[chat]\n")
for a = 1, 8 do
file:write(a .. "=true\n")
end
for a = 1, 3 do
for b = 1, 25 do
file:write("[" .. a*100+b .. "]\n")
file:write("question=\n")
file:write("answer=\n")
end
end
file:close()
end
[ML] (error) SMIHelper.lua: Script died due to error. (01ACF954)