как решить проблему с imgui combo?

cort

Активный
Автор темы
275
79
Lua:
[ML] (system) Loading script 'D:\Games\Namalsk RolePlay\gtacr\moonloader\Namalsk Helper For Leaders.lua'...
[ML] (system) Namalsk Helper For Leaders: Loaded successfully.
[ML] (error) Namalsk Helper For Leaders: ...RolePlay\gtacr\moonloader\Namalsk Helper For Leaders.lua:453: stack index -1, expected table, received nil: value is not a table or a userdata that can behave like one
stack traceback:
    [C]: in function 'Combo'
    ...RolePlay\gtacr\moonloader\Namalsk Helper For Leaders.lua:453: in function 'OnDrawFrame'
    D:\Games\Namalsk RolePlay\gtacr\moonloader\lib\imgui.lua:1378: in function <D:\Games\Namalsk RolePlay\gtacr\moonloader\lib\imgui.lua:1367>
[ML] (error) Namalsk Helper For Leaders: Script died due to an error. (2B2677B4)

вылетает скрипт.


Lua:
if menu == 4 then

            imgui.BeginChild('##gosvolna', imgui.ImVec2(450, 245), true)

            imgui.PushItemWidth(69)
            if imgui.Combo(u8'##1', combotwo, combotwos) then
                mainIni.config.combotwo = combotwo.v
            inicfg.save(mainIni, "namalsk_HFL.ini")
            end
        
            imgui.SameLine()
                imgui.Text('to')
            imgui.SameLine()
        
            if imgui.Combo(u8'##2', comboone, comboones) then
                mainIni.config.comboone = comboone.v
            inicfg.save(mainIni, "namalsk_HFL.ini")
                imgui.PopItemWidth()
            end
            
            imgui.PushItemWidth(152)
            if imgui.InputText(u8"##3", inputtext) then
                mainIni.config.inputtext = inputtext.v
            inicfg.save(mainIni, "namalsk_HFL.ini")
                imgui.PopItemWidth()
            end   
        
            if imgui.Button('Send', imgui.ImVec2(42, 36)) then   
                sampSendChat('/d '..combotwos[combotwo.v + 1].." - "..comboones[comboone.v + 1].. "" ..u8:decode(inputtext.v))
            end

            imgui.EndChild()

        end
        imgui.EndChild()
        imgui.End()
    end

Скрытое содержимое могут видеть только пользователи групп(ы): Администраторы, Всефорумные модераторы, Модераторы, Проверенные


@chapo помоги пожайлуста
 
Последнее редактирование:

chapo

🫡 В армии с 17.10.2023. В ЛС НЕ ОТВЕЧАЮ
Друг
8,771
11,215
Lua:
[ML] (system) Loading script 'D:\Games\Namalsk RolePlay\gtacr\moonloader\Namalsk Helper For Leaders.lua'...
[ML] (system) Namalsk Helper For Leaders: Loaded successfully.
[ML] (error) Namalsk Helper For Leaders: ...RolePlay\gtacr\moonloader\Namalsk Helper For Leaders.lua:453: stack index -1, expected table, received nil: value is not a table or a userdata that can behave like one
stack traceback:
    [C]: in function 'Combo'
    ...RolePlay\gtacr\moonloader\Namalsk Helper For Leaders.lua:453: in function 'OnDrawFrame'
    D:\Games\Namalsk RolePlay\gtacr\moonloader\lib\imgui.lua:1378: in function <D:\Games\Namalsk RolePlay\gtacr\moonloader\lib\imgui.lua:1367>
[ML] (error) Namalsk Helper For Leaders: Script died due to an error. (2B2677B4)

вылетает скрипт.


Lua:
if menu == 4 then

            imgui.BeginChild('##gosvolna', imgui.ImVec2(450, 245), true)

            imgui.PushItemWidth(69)
            if imgui.Combo(u8'##1', combotwo, combotwos) then
                mainIni.config.combotwo = combotwo.v
            inicfg.save(mainIni, "namalsk_HFL.ini")
            end
       
            imgui.SameLine()
                imgui.Text('to')
            imgui.SameLine()
       
            if imgui.Combo(u8'##2', comboone, comboones) then
                mainIni.config.comboone = comboone.v
            inicfg.save(mainIni, "namalsk_HFL.ini")
                imgui.PopItemWidth()
            end
           
            imgui.PushItemWidth(152)
            if imgui.InputText(u8"##3", inputtext) then
                mainIni.config.inputtext = inputtext.v
            inicfg.save(mainIni, "namalsk_HFL.ini")
                imgui.PopItemWidth()
            end  
       
            if imgui.Button('Send', imgui.ImVec2(42, 36)) then  
                sampSendChat('/d '..combotwos[combotwo.v + 1].." - "..comboones[comboone.v + 1].. "" ..u8:decode(inputtext.v))
            end

            imgui.EndChild()

        end
        imgui.EndChild()
        imgui.End()
    end

*** Скрытый текст не может быть процитирован. ***

@chapo помоги пожайлуста
перенеси массивы для комбо вверх кода
 
  • Нравится
Реакции: cort