Вопросы по Lua скриптингу

Общая тема для вопросов по разработке скриптов на языке программирования Lua, в частности под MoonLoader.
  • Задавая вопрос, убедитесь, что его нет в списке частых вопросов и что на него ещё не отвечали (воспользуйтесь поиском).
  • Поищите ответ в теме посвященной разработке Lua скриптов в MoonLoader
  • Отвечая, убедитесь, что ваш ответ корректен.
  • Старайтесь как можно точнее выразить мысль, а если проблема связана с кодом, то обязательно прикрепите его к сообщению, используя блок [code=lua]здесь мог бы быть ваш код[/code].
  • Если вопрос связан с MoonLoader-ом первым делом желательно поискать решение на wiki.

Частые вопросы

Как научиться писать скрипты? С чего начать?
Информация - Гайд - Всё о Lua скриптинге для MoonLoader(https://blast.hk/threads/22707/)
Как вывести текст на русском? Вместо русского текста у меня какие-то каракули.
Изменить кодировку файла скрипта на Windows-1251. В Atom: комбинация клавиш Ctrl+Shift+U, в Notepad++: меню Кодировки -> Кодировки -> Кириллица -> Windows-1251.
Как получить транспорт, в котором сидит игрок?
Lua:
local veh = storeCarCharIsInNoSave(PLAYER_PED)
Как получить свой id или id другого игрока?
Lua:
local _, id = sampGetPlayerIdByCharHandle(PLAYER_PED) -- получить свой ид
local _, id = sampGetPlayerIdByCharHandle(ped) -- получить ид другого игрока. ped - это хендл персонажа
Как проверить, что строка содержит какой-то текст?
Lua:
if string.find(str, 'текст', 1, true) then
-- строка str содержит "текст"
end
Как эмулировать нажатие игровой клавиши?
Lua:
local game_keys = require 'game.keys' -- где-нибудь в начале скрипта вне функции main

setGameKeyState(game_keys.player.FIREWEAPON, -1) -- будет сэмулировано нажатие клавиши атаки
Все иды клавиш находятся в файле moonloader/lib/game/keys.lua.
Подробнее о функции setGameKeyState здесь: lua - setgamekeystate | BlastHack — DEV_WIKI(https://www.blast.hk/wiki/lua:setgamekeystate)
Как получить id другого игрока, в которого целюсь я?
Lua:
local valid, ped = getCharPlayerIsTargeting(PLAYER_HANDLE) -- получить хендл персонажа, в которого целится игрок
if valid and doesCharExist(ped) then -- если цель есть и персонаж существует
  local result, id = sampGetPlayerIdByCharHandle(ped) -- получить samp-ид игрока по хендлу персонажа
  if result then -- проверить, прошло ли получение ида успешно
    -- здесь любые действия с полученным идом игрока
  end
end
Как зарегистрировать команду чата SAMP?
Lua:
-- До бесконечного цикла/задержки
sampRegisterChatCommand("mycommand", function (param)
     -- param будет содержать весь текст введенный после команды, чтобы разделить его на аргументы используйте string.match()
    sampAddChatMessage("MyCMD", -1)
end)
Крашит игру при вызове sampSendChat. Как это исправить?
Это происходит из-за бага в SAMPFUNCS, когда производится попытка отправки пакета определенными функциями изнутри события исходящих RPC и пакетов. Исправления для этого бага нет, но есть способ не провоцировать его. Вызов sampSendChat изнутри обработчика исходящих RPC/пакетов нужно обернуть в скриптовый поток с нулевой задержкой:
Lua:
function onSendRpc(id)
  -- крашит:
  -- sampSendChat('Send RPC: ' .. id)

  -- норм:
  lua_thread.create(function()
    wait(0)
    sampSendChat('Send RPC: ' .. id)
  end)
end
 
Последнее редактирование:

enyag

Известный
345
12
а, диалог? серверный или клиентский?
клиентский
 

Мира

Участник
455
9
как добавить в скрипт женские отыгроки? imgui на M открывается и надо в него добавить пункт, чтобы "включить женские отыгровки". поставить галочку так скажем там и будут отыгровки женские

Lua:
require "lib.moonloader"
local key = require 'vkeys'

local tag = "{DFCFCF}[Damiano Helper] {FFFFFF}"

local imgui = require 'imgui'
local bWnd = imgui.ImBool(false)

local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local band_list = {
    u8"The Rifa",
    u8"Grove Street",
    u8"Los-Santos Vagos",
    u8"East Side Ballas",
    u8"Varios Los Aztecas",
    u8"Night Wolves"
}
local gps = {
'1',
'2',
'3',
'4',
'5',
'10'
}
local inicfg = require 'inicfg'
local mainIni = inicfg.load({
    settings =
    {
        band = 0
    }
}, 'Random.ini')
if not doesFileExist("moonloader/config/Random.ini") then inicfg.save(mainIni, "Random.ini") end
local band = imgui.ImInt(mainIni.settings.band)

local ev = require "lib.samp.events"

local samp = require 'samp.events'

function main()
    if not isSampLoaded() and not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    repeat wait(0) until isSampAvailable()
    sampAddChatMessage(tag.."Helper for Damiano {DFCFCF}by Mira Damiano", -1)
    sampRegisterChatCommand('cc', function() ClearChat() end)
    while true do
        wait(0)
        imgui.Process = bWnd.v
        local res, ped = getCharPlayerIsTargeting(playerHandle)
        if res then
            local proverka = isKeyJustPressed(VK_1)
            if proverka then
                res, ped = getCharPlayerIsTargeting(playerHandle)
                res, id = sampGetPlayerIdByCharHandle(ped)
                id2 = id
                sampSendChat("/faminvite "..id)
            end
        end
        local res, ped = getCharPlayerIsTargeting(playerHandle)
        if res then
            local proverka = isKeyJustPressed(VK_2)
            if proverka then
                res, ped = getCharPlayerIsTargeting(playerHandle)
                res, id = sampGetPlayerIdByCharHandle(ped)
                id2 = id
                sampSendChat("/invite "..id)
                wait(1000)
                sampSendChat("/me выдал бандану человеку напротив")
            end
        end
        local res, ped = getCharPlayerIsTargeting(playerHandle)
        if res then
            local proverka = isKeyJustPressed(VK_3)
            if proverka then
                res, ped = getCharPlayerIsTargeting(playerHandle)
                res, id = sampGetPlayerIdByCharHandle(ped)
                id2 = id
                sampSendChat("/giverank "..id.." 7")
                wait(1000)
                sampSendChat("/me обозначил место в банде")
            end
        end
        if isKeyJustPressed(106)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat("/usedrugs 3")
        end
        if isKeyDown(16) and isKeyJustPressed(48)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            local ip, port = sampGetCurrentServerAddress()
            sampDisconnectWithReason(0)
            wait(15000)
            sampConnectToServer(ip, port)
        end
        if isKeyJustPressed(77)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            bWnd.v = not bWnd.v
        end
        if isKeyJustPressed(109)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat("/mask")
        end
        if isKeyJustPressed(107)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat("/armour")
        end
        if isKeyJustPressed(100)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat('/ad 1 Проходит набор в '..u8:decode(band_list[mainIni.settings.band+1])..'. Принимаем на 7 майку! Мы в GPS 8 - '..gps[mainIni.settings.band+1]..'!')
        end
        if isKeyJustPressed(101)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat('/vr Проходит набор в '..u8:decode(band_list[mainIni.settings.band+1])..'. Принимаем на 7 майку! Мы в GPS 8 - '..gps[mainIni.settings.band+1]..'!')
        end
        if isKeyJustPressed(66)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat(" ")
        end
        if isKeyJustPressed(99)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSetChatInputEnabled(true)
            sampSetChatInputText("/giverank  7")
            sampSetChatInputCursor(10)
        end
        if isKeyJustPressed(98)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSetChatInputEnabled(true)
            sampSetChatInputText("/invite ")
        end
        if isKeyJustPressed(97)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSetChatInputEnabled(true)
            sampSetChatInputText("/faminvite ")
        end
        if isKeyJustPressed(110)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSetChatInputEnabled(true)
            sampSetChatInputText("/uninvite  Выселен!!")
            sampSetChatInputCursor(10)
        end
        if isKeyJustPressed(102)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat('/rt Проходит набор в '..u8:decode(band_list[mainIni.settings.band+1])..'. Принимаем на 7 майку! Мы в GPS 8 - '..gps[mainIni.settings.band+1]..'!')
        end
    end
end

function sampSetChatInputCursor(start, finish)
    local finish = finish or start
    local start, finish = tonumber(start), tonumber(finish)
    local mem = require 'memory'
    local chatInfoPtr = sampGetInputInfoPtr()
    local chatBoxInfo = getStructElement(chatInfoPtr, 0x8, 4)
    mem.setint8(chatBoxInfo + 0x11E, start)
    mem.setint8(chatBoxInfo + 0x119, finish)
    return true
end

function imgui.OnDrawFrame()
  imgui.Begin(u8"Damiano Helper", bWnd)
  imgui.PushItemWidth(130)
  if imgui.Combo(u8'The choice of gang', band, band_list)then
        mainIni.settings.band = band.v
        inicfg.save(mainIni, "Random.ini")
    end imgui.PopItemWidth()
    imgui.End()
end

function ev.onSendChat(text)
    if text == '.time' then
        text = '/time'
        sampSendChat(text)
        return false
    end
    if text == '/ешьу' then
        text = '/time'
        sampSendChat(text)
        return false
    end
    if text == '.ешьу' then
        text = '/time'
        sampSendChat(text)
        return false
    end
    if text == '.lmenu' then
        text = '/lmenu'
        sampSendChat(text)
        return false
    end
    if text == '/дьутг' then
        text = '/lmenu'
        sampSendChat(text)
        return false
    end
    if text == '.дьутг' then
        text = '/lmenu'
        sampSendChat(text)
        return false
    end
    if text == '.armour' then
        text = '/armour'
        sampSendChat(text)
        return false
    end
    if text == '/фкьщгк' then
        text = '/armour'
        sampSendChat(text)
        return false
    end
    if text == '/фкьщгк' then
        text = '/armour'
        sampSendChat(text)
        return false
    end
    if text == '.usedrugs 3' then
        text = '/usedrugs'
        sampSendChat(text)
        return false
    end
    if text == '/гыувкгпы 3' then
        text = '/usedrugs'
        sampSendChat(text)
        return false
    end
    if text == '.гыувкгпы 3' then
        text = '/usedrugs'
        sampSendChat(text)
        return false
    end
    if text == '.mask' then
        text = '/mask'
        sampSendChat(text)
        return false
    end
    if text == '/ьфыл' then
        text = '/mask'
        sampSendChat(text)
        return false
    end
    if text == '.ьфыл' then
        text = '/mask'
        sampSendChat(text)
        return false
    end
end

function ClearChat()
    local memory = require "memory"
    memory.fill(sampGetChatInfoPtr() + 306, 0x0, 25200)
    memory.write(sampGetChatInfoPtr() + 306, 25562, 4, 0x0)
    memory.write(sampGetChatInfoPtr() + 0x63DA, 1, 1)
end

function samp.onSendCommand(cmd)
    if cmd:find('/rep (.+)') then
        report = cmd:match('/rep (.+)')
        cmd = '/rep'
        return {cmd}
    end
    if cmd:find('/report (.+)') then
        report = cmd:match('/report (.+)')
        cmd = '/report'
        return {cmd}
    end
    if cmd:find('/ask (.+)') then
        report = cmd:match('/ask (.+)')
        cmd = '/ask'
        return {cmd}
    end
end

function samp.onShowDialog(id,s,t,b1,b2,text)
    if id == 32 and report ~= nil then
        sampSendDialogResponse(id, 1, _, report)
        report = nil
        return false
    end
end
 

Rei

Известный
Друг
1,589
1,614
как добавить в скрипт женские отыгроки? imgui на M открывается и надо в него добавить пункт, чтобы "включить женские отыгровки". поставить галочку так скажем там и будут отыгровки женские

Lua:
require "lib.moonloader"
local key = require 'vkeys'

local tag = "{DFCFCF}[Damiano Helper] {FFFFFF}"

local imgui = require 'imgui'
local bWnd = imgui.ImBool(false)

local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local band_list = {
    u8"The Rifa",
    u8"Grove Street",
    u8"Los-Santos Vagos",
    u8"East Side Ballas",
    u8"Varios Los Aztecas",
    u8"Night Wolves"
}
local gps = {
'1',
'2',
'3',
'4',
'5',
'10'
}
local inicfg = require 'inicfg'
local mainIni = inicfg.load({
    settings =
    {
        band = 0
    }
}, 'Random.ini')
if not doesFileExist("moonloader/config/Random.ini") then inicfg.save(mainIni, "Random.ini") end
local band = imgui.ImInt(mainIni.settings.band)

local ev = require "lib.samp.events"

local samp = require 'samp.events'

function main()
    if not isSampLoaded() and not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    repeat wait(0) until isSampAvailable()
    sampAddChatMessage(tag.."Helper for Damiano {DFCFCF}by Mira Damiano", -1)
    sampRegisterChatCommand('cc', function() ClearChat() end)
    while true do
        wait(0)
        imgui.Process = bWnd.v
        local res, ped = getCharPlayerIsTargeting(playerHandle)
        if res then
            local proverka = isKeyJustPressed(VK_1)
            if proverka then
                res, ped = getCharPlayerIsTargeting(playerHandle)
                res, id = sampGetPlayerIdByCharHandle(ped)
                id2 = id
                sampSendChat("/faminvite "..id)
            end
        end
        local res, ped = getCharPlayerIsTargeting(playerHandle)
        if res then
            local proverka = isKeyJustPressed(VK_2)
            if proverka then
                res, ped = getCharPlayerIsTargeting(playerHandle)
                res, id = sampGetPlayerIdByCharHandle(ped)
                id2 = id
                sampSendChat("/invite "..id)
                wait(1000)
                sampSendChat("/me выдал бандану человеку напротив")
            end
        end
        local res, ped = getCharPlayerIsTargeting(playerHandle)
        if res then
            local proverka = isKeyJustPressed(VK_3)
            if proverka then
                res, ped = getCharPlayerIsTargeting(playerHandle)
                res, id = sampGetPlayerIdByCharHandle(ped)
                id2 = id
                sampSendChat("/giverank "..id.." 7")
                wait(1000)
                sampSendChat("/me обозначил место в банде")
            end
        end
        if isKeyJustPressed(106)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat("/usedrugs 3")
        end
        if isKeyDown(16) and isKeyJustPressed(48)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            local ip, port = sampGetCurrentServerAddress()
            sampDisconnectWithReason(0)
            wait(15000)
            sampConnectToServer(ip, port)
        end
        if isKeyJustPressed(77)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            bWnd.v = not bWnd.v
        end
        if isKeyJustPressed(109)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat("/mask")
        end
        if isKeyJustPressed(107)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat("/armour")
        end
        if isKeyJustPressed(100)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat('/ad 1 Проходит набор в '..u8:decode(band_list[mainIni.settings.band+1])..'. Принимаем на 7 майку! Мы в GPS 8 - '..gps[mainIni.settings.band+1]..'!')
        end
        if isKeyJustPressed(101)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat('/vr Проходит набор в '..u8:decode(band_list[mainIni.settings.band+1])..'. Принимаем на 7 майку! Мы в GPS 8 - '..gps[mainIni.settings.band+1]..'!')
        end
        if isKeyJustPressed(66)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat(" ")
        end
        if isKeyJustPressed(99)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSetChatInputEnabled(true)
            sampSetChatInputText("/giverank  7")
            sampSetChatInputCursor(10)
        end
        if isKeyJustPressed(98)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSetChatInputEnabled(true)
            sampSetChatInputText("/invite ")
        end
        if isKeyJustPressed(97)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSetChatInputEnabled(true)
            sampSetChatInputText("/faminvite ")
        end
        if isKeyJustPressed(110)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSetChatInputEnabled(true)
            sampSetChatInputText("/uninvite  Выселен!!")
            sampSetChatInputCursor(10)
        end
        if isKeyJustPressed(102)
        and not sampIsChatInputActive()
        and not sampIsDialogActive()
        then
            sampSendChat('/rt Проходит набор в '..u8:decode(band_list[mainIni.settings.band+1])..'. Принимаем на 7 майку! Мы в GPS 8 - '..gps[mainIni.settings.band+1]..'!')
        end
    end
end

function sampSetChatInputCursor(start, finish)
    local finish = finish or start
    local start, finish = tonumber(start), tonumber(finish)
    local mem = require 'memory'
    local chatInfoPtr = sampGetInputInfoPtr()
    local chatBoxInfo = getStructElement(chatInfoPtr, 0x8, 4)
    mem.setint8(chatBoxInfo + 0x11E, start)
    mem.setint8(chatBoxInfo + 0x119, finish)
    return true
end

function imgui.OnDrawFrame()
  imgui.Begin(u8"Damiano Helper", bWnd)
  imgui.PushItemWidth(130)
  if imgui.Combo(u8'The choice of gang', band, band_list)then
        mainIni.settings.band = band.v
        inicfg.save(mainIni, "Random.ini")
    end imgui.PopItemWidth()
    imgui.End()
end

function ev.onSendChat(text)
    if text == '.time' then
        text = '/time'
        sampSendChat(text)
        return false
    end
    if text == '/ешьу' then
        text = '/time'
        sampSendChat(text)
        return false
    end
    if text == '.ешьу' then
        text = '/time'
        sampSendChat(text)
        return false
    end
    if text == '.lmenu' then
        text = '/lmenu'
        sampSendChat(text)
        return false
    end
    if text == '/дьутг' then
        text = '/lmenu'
        sampSendChat(text)
        return false
    end
    if text == '.дьутг' then
        text = '/lmenu'
        sampSendChat(text)
        return false
    end
    if text == '.armour' then
        text = '/armour'
        sampSendChat(text)
        return false
    end
    if text == '/фкьщгк' then
        text = '/armour'
        sampSendChat(text)
        return false
    end
    if text == '/фкьщгк' then
        text = '/armour'
        sampSendChat(text)
        return false
    end
    if text == '.usedrugs 3' then
        text = '/usedrugs'
        sampSendChat(text)
        return false
    end
    if text == '/гыувкгпы 3' then
        text = '/usedrugs'
        sampSendChat(text)
        return false
    end
    if text == '.гыувкгпы 3' then
        text = '/usedrugs'
        sampSendChat(text)
        return false
    end
    if text == '.mask' then
        text = '/mask'
        sampSendChat(text)
        return false
    end
    if text == '/ьфыл' then
        text = '/mask'
        sampSendChat(text)
        return false
    end
    if text == '.ьфыл' then
        text = '/mask'
        sampSendChat(text)
        return false
    end
end

function ClearChat()
    local memory = require "memory"
    memory.fill(sampGetChatInfoPtr() + 306, 0x0, 25200)
    memory.write(sampGetChatInfoPtr() + 306, 25562, 4, 0x0)
    memory.write(sampGetChatInfoPtr() + 0x63DA, 1, 1)
end

function samp.onSendCommand(cmd)
    if cmd:find('/rep (.+)') then
        report = cmd:match('/rep (.+)')
        cmd = '/rep'
        return {cmd}
    end
    if cmd:find('/report (.+)') then
        report = cmd:match('/report (.+)')
        cmd = '/report'
        return {cmd}
    end
    if cmd:find('/ask (.+)') then
        report = cmd:match('/ask (.+)')
        cmd = '/ask'
        return {cmd}
    end
end

function samp.onShowDialog(id,s,t,b1,b2,text)
    if id == 32 and report ~= nil then
        sampSendDialogResponse(id, 1, _, report)
        report = nil
        return false
    end
end
if men then
*мужская отыгровка*
else
*женская отыгровка
end
 

Koksya678

Новичок
5
0
Как поставить проверку на ник. Чтобы считало ответ, например: в чате написано (Nick_Name использовал /med), и чтобы считало в ответ,
 

Мира

Участник
455
9
1593867833683.png

вписал
Lua:
local sw, sh = getScreenResolution()
и
Lua:
  imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
окно переместилось, но не совсем в центр
красная точка это курсор, который появляется после открытия imgui, а то есть это центр моего экрана
 
Последнее редактирование:

CaJlaT

Овощ
Модератор
2,806
2,603
Посмотреть вложение 61313
вписал
Lua:
local sw, sh = getScreenResolution()
и
Lua:
  imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
окно переместилось, но не совсем в центр
красная точка это курсор, который появляется после открытия imgui, а то есть это центр моего экрана
Потомучто оно узнаёт корды, исходя из размера окна, поэтому сначала нужно задать окну определённый размер, а потом уже помещать в центр
 

enyag

Известный
345
12
как сделать, что бы при нажатии на кнопку в listbox открывалось ещё одно окно, а предыдущее закрывалось? это не имгуи, а окно клиентское
 

Мира

Участник
455
9
необходимо вставить код
Lua:
imgui.Chekbox()
куда его можно вставить?
Lua:
function imgui.OnDrawFrame()
 
  imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
  imgui.SetNextWindowSize(imgui.ImVec2(500, 300), imgui.Cond.FirstUseEver)
 
  imgui.Begin(u8"Damiano Helper", bWnd)
  imgui.PushItemWidth(130)
  if imgui.Combo(u8'The choice of gang', band, band_list)then
        mainIni.settings.band = band.v
        inicfg.save(mainIni, "Random.ini")
    end imgui.PopItemWidth()
    imgui.End()
end
 

Fott

Простреленный
3,423
2,249
необходимо вставить код
Lua:
imgui.Chekbox()
куда его можно вставить?
Lua:
function imgui.OnDrawFrame()

  imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
  imgui.SetNextWindowSize(imgui.ImVec2(500, 300), imgui.Cond.FirstUseEver)

  imgui.Begin(u8"Damiano Helper", bWnd)
  imgui.PushItemWidth(130)
  if imgui.Combo(u8'The choice of gang', band, band_list)then
        mainIni.settings.band = band.v
        inicfg.save(mainIni, "Random.ini")
    end imgui.PopItemWidth()
    imgui.End()
end
Очень тупой вопрос, посмотри видео обучалки луа пж
Lua:
function imgui.OnDrawFrame()
 
  imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
  imgui.SetNextWindowSize(imgui.ImVec2(500, 300), imgui.Cond.FirstUseEver)
 
  imgui.Begin(u8"Damiano Helper", bWnd)
  imgui.Chekbox()
  imgui.PushItemWidth(130)
  if imgui.Combo(u8'The choice of gang', band, band_list)then
        mainIni.settings.band = band.v
        inicfg.save(mainIni, "Random.ini")
    end imgui.PopItemWidth()
    imgui.End()
end