local imgui = require('imgui')
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local window = imgui.ImBool(false)
local requests = require('requests')
local RESP_TEXT = 'loading...' -- тут текст с сайта
function main()
while not isSampAvailable() do wait(200) end
imgui.Process = false
window.v = true --show window on start
local response = requests.get('https://raw.githubusercontent.com/GovnocodedByChapo/ParadoxRpAdminHelper/main/users.json') -- тут ссылка на сайт
if response.status_code == 200 then
RESP_TEXT = response.text
else
RESP_TEXT = 'Code '..response.status_code
end
while true do
wait(0)
imgui.Process = window.v
end
end
function imgui.OnDrawFrame()
if window.v then
local resX, resY = getScreenResolution()
local sizeX, sizeY = 300, 300 -- WINDOW SIZE
imgui.SetNextWindowPos(imgui.ImVec2(resX / 2 - sizeX / 2, resY / 2 - sizeY / 2), imgui.Cond.FirstUseEver)
imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
imgui.Begin('Window Title', window)
imgui.Text(u8'Текст с сайта: '..RESP_TEXT)
imgui.End()
end
end