не сохраняет значение combo

boy next door

Участник
Автор темы
243
22
Версия MoonLoader
.026-beta
помогите пожалуйста.
Lua:
        if (imgui.ComboStr('', aselected, acomboStr .. '\0', -1)) then
            print('Selected frac name', afracNames[aselected[0] + 1][2]);
            ini.settings.leaderid = leaderid[0]
            inicfg.save(ini, directIni)
        end

Lua:
local afracNames = {
    {1, 'LSPD', 3},
    {2, 'FBI', 3},
    {3, 'Army LS', 3},
    {4, 'Hospital LS', 3},
    {5, 'La Cosa Nostra', 2},
    {6, 'Yakuza', 2},
    {7, 'Mayor', 3},
    {11, 'Warlocks MC', 2},
    {12, 'The Ballas', 1},
    {13, 'Los Santos Vagos', 1},
    {14, 'Russian Mafia', 2},
    {15, 'Grove Street', 1},
    {16, 'San News', 3},
    {17, 'Varios Los Aztecas', 1},
    {18, 'The Rifa', 1},
    {23, 'Hitmans Agency', 4},
    {25, 'S.W.A.T', 3},
    {26, 'Government', 3}
};
local acomboStr = (function()
    local names = {};
    for _, frac in ipairs(afracNames) do
        table.insert(names, frac[2]);
    end
    return table.concat(names, '\0');
end)();
local aselected = imgui.new.int(0);


Lua:
local directIni = 'AllHelper'
local ini = inicfg.load(inicfg.load({
    decoration = {
        theme = 0,
        style = 0
    },
    settings = {
        leaderid = 1
    },
}, directIni))
inicfg.save(ini, directIni)
local leaderid = new.int(ini.settings.leaderid)

function onScriptTerminate(s)
    if s == thisScript() then
    ini.decoration.theme = colorListNumber[0]
    ini.decoration.style = decorListNumber[0]
    ini.settings.leaderid = leaderid[0]
    inicfg.save(ini, directIni)
    end
end
 

boy next door

Участник
Автор темы
243
22
попробуй это
lua:
if (imgui.ComboStr('', aselected, acomboStr .. '\0', -1)) then
        ini.settings.leaderid = afracNames[aselected[0] + 1][1]
        print('Selected frac name', afracNames[aselected[0] + 1][2])
        inicfg.save(ini, directIni)
    end
Видео без названия — сделано в Clipchamp.gif


помогите пожалуйста.
Lua:
        if (imgui.ComboStr('', aselected, acomboStr .. '\0', -1)) then
            print('Selected frac name', afracNames[aselected[0] + 1][2]);
            ini.settings.leaderid = leaderid[0]
            inicfg.save(ini, directIni)
        end

Lua:
local afracNames = {
    {1, 'LSPD', 3},
    {2, 'FBI', 3},
    {3, 'Army LS', 3},
    {4, 'Hospital LS', 3},
    {5, 'La Cosa Nostra', 2},
    {6, 'Yakuza', 2},
    {7, 'Mayor', 3},
    {11, 'Warlocks MC', 2},
    {12, 'The Ballas', 1},
    {13, 'Los Santos Vagos', 1},
    {14, 'Russian Mafia', 2},
    {15, 'Grove Street', 1},
    {16, 'San News', 3},
    {17, 'Varios Los Aztecas', 1},
    {18, 'The Rifa', 1},
    {23, 'Hitmans Agency', 4},
    {25, 'S.W.A.T', 3},
    {26, 'Government', 3}
};
local acomboStr = (function()
    local names = {};
    for _, frac in ipairs(afracNames) do
        table.insert(names, frac[2]);
    end
    return table.concat(names, '\0');
end)();
local aselected = imgui.new.int(0);


Lua:
local directIni = 'AllHelper'
local ini = inicfg.load(inicfg.load({
    decoration = {
        theme = 0,
        style = 0
    },
    settings = {
        leaderid = 1
    },
}, directIni))
inicfg.save(ini, directIni)
local leaderid = new.int(ini.settings.leaderid)

function onScriptTerminate(s)
    if s == thisScript() then
    ini.decoration.theme = colorListNumber[0]
    ini.decoration.style = decorListNumber[0]
    ini.settings.leaderid = leaderid[0]
    inicfg.save(ini, directIni)
    end
end
Решено.
 
Последнее редактирование:
  • Нравится
Реакции: - |2347| -