local imgui = require 'imgui'
local key = require 'vkeys'
local main_window_state = imgui.ImBool(false)
function main()
while true do
wait(0)
if wasKeyPressed(key.VK_P) then -- активация по нажатию клавиши X
main_window_state.v = not main_window_state.v
end
imgui.Process = main_window_state.v
end
end
function imgui.OnDrawFrame()
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(150, 200), imgui.Cond.FirstUseEver)
imgui.Begin('Test script', main_window_state)
if imgui.Button('Press me') then
sampAddChatMessage('Сработало', -1)
end
imgui.End()
end
end