require "lib.moonloader"
require 'lib.vkeys'
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local report_window_state = imgui.ImBool(true)
local butt = true
function imgui.OnDrawFrame()
if report_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(250, 150), imgui.Cond.FirstUseEver)
imgui.Begin(u8'Окно', report_window_state, imgui.WindowFlags.NoResize)
if butt then
imgui.PushStyleColor(imgui.Col.Button, imgui.ImVec4(0.00, 128.00, 0.00, 0.65))
if imgui.Button(u8'Кнопка') then
butt = false
xzz() -- функция
end
imgui.PopStyleColor(1)
elseif not butt then
if imgui.Button(u8'Кнопка') then
butt = true
end
end
imgui.End()
end
end
function xzz()
sampAddChatMessage('Повтори код, либо добавь код в функцию и призывай где надо',-1)
end
function main()
sampRegisterChatCommand('cmd',function() report_window_state.v = not report_window_state.v end)
while true do wait(0)
if isKeyJustPressed(13) and (butt or not butt) then
butt = not butt
xzz() -- функция
end
imgui.Process = report_window_state.v
imgui.ShowCursor = report_window_state.v
end
end