local keys = require "vkeys"
require "lib.moonloader"
local imgui = require "imgui"
local encoding = require "encoding"
encoding.default = 'CP1251'
u8 = encoding.UTF8
local sw, sh = getScreenResolution()
local m_w_s = imgui.ImBool(false)
function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
while true do
wait (0)
local res, tar = getCharPlayerIsTargeting(PLAYR_HANDLE)
if res then res, tarId = sampGetPlayerIdByCharHandle(tar) end
if res and isKeyJustPressed(VK_B) then
wind()
end
if m_w_s.v == false then
imgui.Process = false
end
end
end
function imgui.OnDrawFrame()
imgui.SetNextWindowSize(imgui.ImVec2(300,255), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2((sw/2),(sh/2)), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.Begin(u8'Меню повышения', m_w_s)
if imgui.Button(u8'Повысить')then
sampSendChat('/повышение ' ..tarId)
end
if imgui.Button(u8'Понизить') then
sampSendChat(u8'/повышение')
end
imgui.End()
end
function wind()
m_w_s.v = not m_w_s.v
imgui.Process = m_w_s.v
end