local samp = require 'lib.samp.events'
local imgui = require "imgui"
local current_player = -1
local spec_tools = imgui.ImBool(false)
function samp.onTogglePlayerSpectating(state)
spec_tools.v = state
if not state then
current_player = -1
end
end
function samp.onSpectatePlayer(id, type)
current_player = id
end
function imgui.OnDrawFrame()
if spec_tools.v then
imgui.SetNextWindowSize(imgui.ImVec2(400, 150), spec_tools, imgui.Cond.FirstUseEver)
if not window_pos then
ScreenX, ScreenY = getScreenResolution()
imgui.SetNextWindowPos(imgui.ImVec2(ScreenX / 2 , ScreenY / 5), imgui.Cond.FirsUseEver, imgui.ImVec2(0.5, 0.5))
window_pos = true
end
imgui.Begin('Spec window', spec_tools, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse + imgui.WindowFlags.NoScrollbar + imgui.NoMove)
imgui.Text("Current player - "..current_player)
imgui.End()
end
end