[Lua] Текст [Lua]

Статус
В этой теме нельзя размещать новые ответы.

Immortal-

Участник
Автор темы
67
1
Версия MoonLoader
Другое
Здравствуйте, видел что в биндере реализовано большое текстовое поле, и текст выводит весь, а не только 1 строку, как такое реализовать?
 
Решение
Lua:
local binds = imgui.ImBuffer(65000)
local delay = imgui.ImInt(1000)
function bind()
    lua_thread.create(function()
        local delay = tonumber(delay.v)
        for str in string.gmatch(binds.v, "[^\r\n]+") do
            sampAddChatMessage(u8:decode(str), -1)
            wait(delay)
        end
    end)
end
--OnDrawFrame
imgui.InputTextMultiline('', binds, imgui.ImVec2(400, 400))
imgui.InputInt(u8'Задержка в МС:', delay)
imgui.SameLine()
if imgui.Button(u8'Запустить бинд') then
    if #binds.v == 0 then
        sampAddChatMessage('Ошибка, введите текст', -1)
    else
        bind()
    end
end

CaJlaT

07.11.2024 14:55
Модератор
2,846
2,683
Lua:
local binds = imgui.ImBuffer(65000)
local delay = imgui.ImInt(1000)
function bind()
    lua_thread.create(function()
        local delay = tonumber(delay.v)
        for str in string.gmatch(binds.v, "[^\r\n]+") do
            sampAddChatMessage(u8:decode(str), -1)
            wait(delay)
        end
    end)
end
--OnDrawFrame
imgui.InputTextMultiline('', binds, imgui.ImVec2(400, 400))
imgui.InputInt(u8'Задержка в МС:', delay)
imgui.SameLine()
if imgui.Button(u8'Запустить бинд') then
    if #binds.v == 0 then
        sampAddChatMessage('Ошибка, введите текст', -1)
    else
        bind()
    end
end
 

TSIDEX

Известный
86
8
Lua:
local binds = imgui.ImBuffer(65000)
local delay = imgui.ImInt(1000)
function bind()
    lua_thread.create(function()
        local delay = tonumber(delay.v)
        for str in string.gmatch(binds.v, "[^\r\n]+") do
            sampAddChatMessage(u8:decode(str), -1)
            wait(delay)
        end
    end)
end
--OnDrawFrame
imgui.InputTextMultiline('', binds, imgui.ImVec2(400, 400))
imgui.InputInt(u8'Задержка в МС:', delay)
imgui.SameLine()
if imgui.Button(u8'Запустить бинд') then
    if #binds.v == 0 then
        sampAddChatMessage('Ошибка, введите текст', -1)
    else
        bind()
    end
end
Привет, не подскажешь как добавить аргументы для этих биндов?
 
Статус
В этой теме нельзя размещать новые ответы.