local tags = {
['{id}'] = select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)),
['{name}'] = sampGetPlayerNickname(select(2, sampGetPlayerIdByCharHandle(PLAYER_PED)))
}
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local test_text_buffer = imgui.ImBuffer(256)
function imgui.OnDrawFrame()
imgui.Begin(u8'Основное окно')
if imgui.InputText(u8'Вводить текст сюда', test_text_buffer) then
for tag, value in pairs(tags) do
test_text_buffer.v = test_text_buffer.v:gsub(tag, value)
end
end
imgui.Text(u8'Введённый текст: ' .. test_text_buffer.v)
imgui.End()
end