local imgui = require('mimgui');
local ffi = require('ffi');
local encoding = require('encoding');
encoding.default = 'CP1251';
local u8 = encoding.UTF8;
local window = imgui.new.bool(true);
imgui.OnInitialize(function ()
imgui.GetIO().IniFilename = nil;
end);
local active = imgui.new.bool(false)
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('test', function ()
imgui.OnFrame(
function () return true end,
function (this)
local size, res = imgui.ImVec2(450, 250), imgui.ImVec2(getScreenResolution());
imgui.SetNextWindowSize(size, imgui.Cond.FirstUseEver);
imgui.SetNextWindowPos(imgui.ImVec2(res.x / 2, res.y / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5));
if (imgui.Begin('test window', window, imgui.WindowFlags.NoCollapse)) then
if (imgui.Button(u8'Здарова, долбаеб!', imgui.ImVec2(150,50))) then
sampAddChatMessage('Ты нажал на меня!', -1);
end
if (imgui.Checkbox(u8'Статус Работы', active)) then
sampAddChatMessage('Чекбокс ' .. (active[0] and 'Включен' or 'Выключен'), -1);
end
end
imgui.End();
end
);
end);
end