ошибка

Bene //

Участник
Автор темы
127
6
Версия MoonLoader
.027.0-preview
Ошибка при загрузки скрипта:

[ML] (error) VH_ADSender.lua: opcode '0B39' call caused an unhandled exception
stack traceback:
[C]: in function 'sampGetCurrentServerAddress'
C:\Games\TRPtwo\moonloader\VH_ADSender.lua:45: in main chunk

код: ( в ошибке строка 45 - тут строка 4 )
Код:
if not doesDirectoryExist(getWorkingDirectory().."/config") then
 createDirectory(getWorkingDirectory().."/config")
end
if not doesDirectoryExist(getWorkingDirectory().."/config/VH_ADSender/"..sampGetCurrentServerAddress()) then
 createDirectory(getWorkingDirectory().."/config/VH_ADSender/"..sampGetCurrentServerAddress())
end

local tableConfig = {
    ["active"] = true,
    ["HOUSE"] = {},
    ["HouseAds"] = {},
    ["StartAd"] = {}
 }

 local linkConfig = getWorkingDirectory() .. "/config/VH_ADSender/"..sampGetCurrentServerAddress().."/"..sampGetPlayerNickname(sampGetPlayerIdByCharHandle(playerPed))..".json"
 if not doesFileExist(linkConfig) then
     local file = io.open(linkConfig, "w")
     file:write(encodeJson(tableConfig))
     io.close(file)
 end
 if doesFileExist(linkConfig) then
     local file = io.open(linkConfig, "r")
     if file then
         local code = decodeJson(file:read("*a"))
end
local file = io.open(linkConfig, "r")
if file then
     db = decodeJson(file:read("*a"))
end
io.close(file)
end
 
  • Эм
Реакции: qdIbp

Bene //

Участник
Автор темы
127
6
нахуя пересоздавать тему если в прошлой теме я дал тебе ответ?
пришли пожалуйста еще раз, я ту тему удалил и я не видел твой ответ
удалил потому что думал что решил проблему)
 
Последнее редактирование:
  • Bug
Реакции: qdIbp

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,771
11,214
1695076604014.png
 
  • Нравится
Реакции: Bene //

Bene //

Участник
Автор темы
127
6
У меня мультилайн из-за этого не работает...
теперь такая ошибка
[ML] (error) VH_ADSender.lua: C:\Games\TRPtwo\moonloader\VH_ADSender.lua:46: attempt to index global 'db' (a nil value)
stack traceback:
C:\Games\TRPtwo\moonloader\VH_ADSender.lua:46: in main chunk
[ML] (error) VH_ADSender.lua: Script died due to an error. (19EFD50C)

46 строка:

Код:
local multiLine = imgui.ImBuffer(u8(table.concat(db["HouseAds"], "\n")), 19999)