local imgui = require('imgui')
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local window = imgui.ImBool(false)
local gm = {
--[[BP]]{state = false, name = 'BULLETS', msg = 'пуль'},
--[[FP]]{state = false, name = 'FIRE', msg = 'огня'},
--[[EP]]{state = false, name = 'EXPLOSIONS', msg = 'взрывов'},
--[[CP]]{state = false, name = 'FALL', msg = 'падения'},
--[[MP]]{state = false, name = 'FIST', msg = 'оружия ближнего боя'},
}
function main()
while not isSampAvailable() do wait(200) end
sampRegisterChatCommand('multigm', function()
window.v = not window.v
end)
imgui.Process = false
window.v = false --show window
while true do
wait(0)
imgui.Process = window.v
end
end
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
style.WindowPadding = imgui.ImVec2(9, 5)
style.WindowRounding = 10
style.ChildWindowRounding = 10
style.FramePadding = imgui.ImVec2(5, 3)
style.FrameRounding = 6.0
style.ItemSpacing = imgui.ImVec2(9.0, 3.0)
style.ItemInnerSpacing = imgui.ImVec2(9.0, 3.0)
style.IndentSpacing = 21
style.ScrollbarSize = 6.0
style.ScrollbarRounding = 13
style.GrabMinSize = 17.0
style.GrabRounding = 16.0
style.WindowTitleAlign = imgui.ImVec2(0.5, 0.5)
style.ButtonTextAlign = imgui.ImVec2(0.5, 0.5)
colors[clr.Text] = ImVec4(0.90, 0.90, 0.90, 1.00)
colors[clr.WindowBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.TitleBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.TitleBgActive] = ImVec4(0.46, 0.46, 0.46, 1.00)
colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.Button] = ImVec4(0.51, 0.51, 0.51, 0.60)
colors[clr.ButtonHovered] = ImVec4(0.68, 0.68, 0.68, 1.00)
colors[clr.ButtonActive] = ImVec4(0.67, 0.67, 0.67, 1.00)
colors[clr.CloseButton] = ImVec4(0.45, 0.45, 0.45, 0.50)
colors[clr.CloseButtonHovered] = ImVec4(0.70, 0.70, 0.90, 0.60)
colors[clr.CloseButtonActive] = ImVec4(0.70, 0.70, 0.70, 1.00)
function imgui.OnDrawFrame()
if window.v then
imgui.SetNextWindowPos(imgui.ImVec2(350.0, 250.0), imgui.Cond.FirstUseEver)
imgui.SetNextWindowSize(imgui.ImVec2(110, 20 * #gm + 5 * #gm + 10 + 23), imgui.Cond.FirstUseEver)
imgui.Begin('Multi GM', window, imgui.WindowFlags.NoResize)
imgui.SetCursorPos(imgui.ImVec2(5, 25))
imgui.BeginChild('left', imgui.ImVec2(100, 20 * #gm + 5 * #gm + 10 - 5), true)
for i = 1, #gm do
imgui.SetCursorPos(imgui.ImVec2(5, i * 5 + (i - 1) * 20))
if imgui.Button(gm[i].name, imgui.ImVec2(90, 20)) then
gm[i].state = not gm[i].state
setCharProofs(PLAYER_PED, gm[1].state, gm[2].state, gm[3].state, gm[4].state, gm[5].state)
sampAddChatMessage('ГМ от '..gm[i].msg..(gm[i].state and ' включен!' or ' выключен!'), -1)
end
end
imgui.EndChild()
imgui.End()
end
end