Как создать диологовое окно?

the same

Активный
Автор темы
173
25
Версия MoonLoader
Другое
Как создать диологовое окно, чтоб при нажатие кнопки, выводил текст в чат (грубо говоря биндер)?

Можно просто скинуть исходник, который будет работать. Буду благодарен
 
Решение
Lua:
function main()
    while not isSampAvailable() do wait(200) end
        sampRegisterChatCommand("lecture",lecture)
    while true do
    wait(0)
    end
end
    
function lecture()
    stopThread = true
    sampShowDialog(1999, "{0633E5}Тестовое окно", string.format("{FFFFFF}1.Тест1.\n2.Тест2."), "Выбрать", "Отмена", 2)
    lua_thread.create(function()
        wait(100)
        stopThread = false
    repeat
        wait(0)
        local result, button, list, input = sampHasDialogRespond(1999)
        if result then
            if button == 1 then -- Если кнопка выбрать
                if list == 0 then --  тест1
                    sampSendChat('Твоё сообщение')
                end
                if list == 1 then -- тест2...

Manuel Leon

Известный
267
165
Lua:
function main()
    while not isSampAvailable() do wait(200) end
        sampRegisterChatCommand("lecture",lecture)
    while true do
    wait(0)
    end
end
    
function lecture()
    stopThread = true
    sampShowDialog(1999, "{0633E5}Тестовое окно", string.format("{FFFFFF}1.Тест1.\n2.Тест2."), "Выбрать", "Отмена", 2)
    lua_thread.create(function()
        wait(100)
        stopThread = false
    repeat
        wait(0)
        local result, button, list, input = sampHasDialogRespond(1999)
        if result then
            if button == 1 then -- Если кнопка выбрать
                if list == 0 then --  тест1
                    sampSendChat('Твоё сообщение')
                end
                if list == 1 then -- тест2
                    sampSendChat('Твоё сообщение')
                end
            end
        end
    until not sampIsDialogActive() or stopThread
    end)
end