local imgui = require 'imgui'
local key = require 'vkeys'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
tabl = {
['help'] = 'helping',
['slap'] = 'slaping',
['gym'] = 'gyming',
['mycym'] = 'mycyming'
}
local main_window_state = imgui.ImBool(false)
local test_text_buffer = imgui.ImBuffer(256)
function imgui.OnDrawFrame()
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(150, 200), imgui.Cond.FirstUseEver)
imgui.Begin('My window', main_window_state)
for i,k in pairs(tabl) do
imgui.Button(i)
end
imgui.Text('Hello world')
imgui.InputText(u8'Вводить текст сюда', test_text_buffer)
if imgui.Button(u8'Поиск') then
for i,k in pairs(tabl) do
if i:find(test_text_buffer.v) then
sampAddChatMessage(i,-1)
end
end
end
imgui.End()
end
end
function main()
while true do wait(0)
if wasKeyPressed(key.VK_X) then main_window_state.v = not main_window_state.v end
imgui.Process = main_window_state.v
end
end