local imgui = require 'imgui'
local key = require 'vkeys'
local samp = require 'lib.samp.events'
require 'moonloader'
--local active = false
local main_window_state = imgui.ImBool(false)
function main()
while true do wait(0)
if wasKeyPressed(key.VK_CONTROL) and ampTextdrawIsOnScreen(2051) then
--active = not active
main_window_state.v = not main_window_state.v
end
imgui.Process = main_window_state.v
end
end
function imgui.OnDrawFrame()
if not main_window_state.v then
imgui.Process = false
end
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(150, 200), imgui.Cond.FirstUseEver)
imgui.Begin('Window1', main_window_state)
imgui.Text('Hello world')
imgui.End()
end
end
function sampTextdrawIsOnScreen(id)
if sampTextdrawIsExists(id) then
local resX, resY = getScreenResolution()
local rX, rY = convertWindowScreenCoordsToGameScreenCoords(resX, resY)
local tdX, tdY = sampTextdrawGetPos(id)
if tdX >= 0 and tdX <= rX and tdY >= 0 and tdY <= rY then
return true
else
return false
end
else
return false
end
end