local imgui = require 'imgui'
local encoding = require("encoding")
encoding.default = 'CP1251'
u8 = encoding.UTF8
local sw, sh = getScreenResolution()
local main_window_state = imgui.ImBool(false)
function main()
while not isSampAvailable() do wait(0) end wait(1)
sampRegisterChatCommand('knop', knop)
imgui.Process = false
while true do
wait(0)
end
end
function imgui.OnDrawFrame()
if not main_window_state.v then
imgui.Process = false
end
if main_window_state.v then
imgui.SetNextWindowPos(imgui.ImVec2(sw / 2 , sh / 2), imgui.Cond.FirsUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(u8"Заголовок", main_window_state)
if imgui.Button(u8'Кнопка 1') then
sampSendChat('Ок')
end
if imgui.Button(u8'Кнопка 2') then
sampSendChat('Окккк')
end
if imgui.Button(u8'Кнопка 3') then
imgui.Process = false
end
imgui.End()
end
end
function knop(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end