script_name("Example script")
local imgui = require 'imgui'
function main()
while true do
wait(0)
imgui.Process = true
end
end
function join_argb(a, r, g, b)
local argb = b -- b
argb = bit.bor(argb, bit.lshift(g, 8)) -- g
argb = bit.bor(argb, bit.lshift(r, 16)) -- r
argb = bit.bor(argb, bit.lshift(a, 24)) -- a
return argb
end
local color = imgui.ImFloat3(1.0, 1.0, 1.0)
function imgui.OnDrawFrame()
imgui.Begin('test')
imgui.ColorEdit3('test', color)
if imgui.Button('save') then
local clr = join_argb(0, color.v[1] * 255, color.v[2] * 255, color.v[3] * 255)
sampAddChatMessage(('CLR: %06X | Example: {%06X}text'):format(clr, clr), -1)
end
imgui.End()
end