Mobile Arizona ошибка inicfg в mimgui

qwazz1x

Новичок
Автор темы
9
1
Версия SA-MP
  1. Любая
Lua:
local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local ffi = require 'ffi'
local new = imgui.new
local themesList = {}
local fa = require('fAwesome6_solid')
require 'widgets'
local iniFile = 'funhelpertheme.ini'
local inicfg = require 'inicfg'
local ini = inicfg.load({
cfg={
cfgtheme = {
theme = 0
}
},
}, "funhelpertheme")
local theme = new.int(ini.cfgtheme.theme)
if not doesDirectoryExist(getWorkingDirectory()..'\\config') then
print('Creating the config directory') createDirectory(getWorkingDirectory()..'\\config')
end
if not doesFileExist('monetloader/config/'..iniFile) then
print('Creating/updating the .ini file') inicfg.save(ini, iniFile)
end
function iniSave()
ini.cfgtheme.theme = theme[0]
inicfg.save(ini, iniFile)
end
function main()
while not isSampAvailable() do wait(100) end
repeat
wait(0)
until sampIsLocalPlayerSpawned()
sampAddChatMessage("{#C8C8C8}Скрипт успешно загружен, активация /fh", -1)
end
imgui.OnInitialize(function()
fa.Init()

end)
local WinState = new.bool(false)
local Checkbox = new.bool(false)
local colorListNumber = new.int()
local sliderBuf = new.int()
local function sendCommand(cmd)
if isSampAvailable() then
sampSendChat('/' .. cmd)
end
end
local function teleportToCoordinates(x, y, z)
local ped = PLAYER_PED
if ped then
setCharCoordinates(ped, x, y, z)
sampAddChatMessage("{C8C8C8}Вы были успешно телепортированы!", -1)
else
sampAddChatMessage("{C8C8C8}Ошибка: Не удалось получить координаты!", -1)
end
end
local currentTab = 1
говорит ошибка в local theme = new.int(ini.cfgtheme.theme) хотя он есть в local
я плохо знаю inicfg
Код:
[13:34:36.090189] (error) FunHelper: ...d/media/com.arizona.game/monetloader/funhelper(beta).lua:24: attempt to index field 'cfgtheme' (a nil value)
stack traceback:
 ...d/media/com.arizona.game/monetloader/funhelper(beta).lua:24: in main chunk