local imgui = require 'mimgui'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local renderWindow = imgui.new.bool()
local winid = imgui.new.int()
imgui.OnInitialize(function()
imgui.GetIO().IniFilename = nil
end)
local newFrame = imgui.OnFrame(
function() return renderWindow[0] end,
function(player)
local resX, resY = getScreenResolution()
local sizeX, sizeY = 300, 300
imgui.SetNextWindowPos(imgui.ImVec2(resX / 2, resY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
if imgui.Begin(u8'Основное окно', renderWindow) then
imgui.InputInt('##WINNER_ID', winid, 1, 999)
local wwwid = sampGetPlayerNickname(winid[0])
imgui.TextWrapped(u8'Игрок под ником '..wwwid..' выиграл!')
imgui.End()
end
end
)
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('window', function()
renderWindow[0] = not renderWindow[0]
end)
wait(-1)
end