Не работает imgui не могу понять что тут не так?

Hader

Потрачен
Автор темы
37
3
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
Версия MoonLoader
.026-beta
Не работает imgui не могу понять что тут не так?
lua:
local imgui = require 'imgui'
local key = require 'vkeys'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
imgui.SwitchContext()
local style = imgui.GetStyle()
local colors = style.Colors
local clr = imgui.Col
local ImVec4 = imgui.ImVec4
local main_window_state = imgui.ImBool(false)
local window = imgui.ImBool(false)
local sw, sh = getScreenResolution()
local memory = require 'memory'

style.Alpha = 1.0
style.ChildWindowRounding = 3
style.WindowRounding = 3
style.GrabRounding = 1
style.GrabMinSize = 20
style.FrameRounding = 3

colors[clr.Text] = ImVec4(0.00, 1.00, 1.00, 1.00)
colors[clr.TextDisabled] = ImVec4(0.00, 0.40, 0.41, 1.00)
colors[clr.WindowBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
colors[clr.ChildWindowBg] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.Border] = ImVec4(0.00, 1.00, 1.00, 0.65)
colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
colors[clr.FrameBg] = ImVec4(0.44, 0.80, 0.80, 0.18)
colors[clr.FrameBgHovered] = ImVec4(0.44, 0.80, 0.80, 0.27)
colors[clr.FrameBgActive] = ImVec4(0.44, 0.81, 0.86, 0.66)
colors[clr.TitleBg] = ImVec4(0.14, 0.18, 0.21, 0.73)
colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.54)
colors[clr.TitleBgActive] = ImVec4(0.00, 1.00, 1.00, 0.27)
colors[clr.MenuBarBg] = ImVec4(0.00, 0.00, 0.00, 0.20)
colors[clr.ScrollbarBg] = ImVec4(0.22, 0.29, 0.30, 0.71)
colors[clr.ScrollbarGrab] = ImVec4(0.00, 1.00, 1.00, 0.44)
colors[clr.ScrollbarGrabHovered] = ImVec4(0.00, 1.00, 1.00, 0.74)
colors[clr.ScrollbarGrabActive] = ImVec4(0.00, 1.00, 1.00, 1.00)
colors[clr.ComboBg] = ImVec4(0.16, 0.24, 0.22, 0.60)
colors[clr.CheckMark] = ImVec4(0.00, 1.00, 1.00, 0.68)
colors[clr.SliderGrab] = ImVec4(0.00, 1.00, 1.00, 0.36)
colors[clr.SliderGrabActive] = ImVec4(0.00, 1.00, 1.00, 0.76)
colors[clr.Button] = ImVec4(0.00, 0.65, 0.65, 0.46)
colors[clr.ButtonHovered] = ImVec4(0.01, 1.00, 1.00, 0.43)
colors[clr.ButtonActive] = ImVec4(0.00, 1.00, 1.00, 0.62)
colors[clr.Header] = ImVec4(0.00, 1.00, 1.00, 0.33)
colors[clr.HeaderHovered] = ImVec4(0.00, 1.00, 1.00, 0.42)
colors[clr.HeaderActive] = ImVec4(0.00, 1.00, 1.00, 0.54)
colors[clr.ResizeGrip] = ImVec4(0.00, 1.00, 1.00, 0.54)
colors[clr.ResizeGripHovered] = ImVec4(0.00, 1.00, 1.00, 0.74)
colors[clr.ResizeGripActive] = ImVec4(0.00, 1.00, 1.00, 1.00)
colors[clr.CloseButton] = ImVec4(0.00, 0.78, 0.78, 0.35)
colors[clr.CloseButtonHovered] = ImVec4(0.00, 0.78, 0.78, 0.47)
colors[clr.CloseButtonActive] = ImVec4(0.00, 0.78, 0.78, 1.00)
colors[clr.PlotLines] = ImVec4(0.00, 1.00, 1.00, 1.00)
colors[clr.PlotLinesHovered] = ImVec4(0.00, 1.00, 1.00, 1.00)
colors[clr.PlotHistogram] = ImVec4(0.00, 1.00, 1.00, 1.00)
colors[clr.PlotHistogramHovered] = ImVec4(0.00, 1.00, 1.00, 1.00)
colors[clr.TextSelectedBg] = ImVec4(0.00, 1.00, 1.00, 0.22)
colors[clr.ModalWindowDarkening] = ImVec4(0.04, 0.10, 0.09, 0.51)

function imgui.Link(link, text)
    text = text or link
    local tSize = imgui.CalcTextSize(text)
    local p = imgui.GetCursorScreenPos()
    local DL = imgui.GetWindowDrawList()
    local col = { 0xFFFF7700, 0xFFFF9900 }
    if imgui.InvisibleButton("##" .. link, tSize) then os.execute("explorer " .. link) end
    local color = imgui.IsItemHovered() and col[1] or col[2]
    DL:AddText(p, color, text)
    DL:AddLine(imgui.ImVec2(p.x, p.y + tSize.y), imgui.ImVec2(p.x + tSize.x, p.y + tSize.y), color)
end

function imgui.OnDrawFrame()
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(350, 400), imgui.Cond.FirstUseEver)
imgui.SetNextWindowPos(imgui.ImVec2(1112, 234), imgui.Cond.FirstUseEver)
imgui.Begin(u8'Биндер для Arizona RP by HaDeR', main_window_state)
imgui.Text(u8'Биндер активен! Hader.')
imgui.Separator()
if imgui.CollapsingHeader(u8"Бинды") then
if imgui.Button(u8'Статистика') then
sampSendChat("/stats")
end
if imgui.Button(u8'Репорт') then
sampSendChat("/report")
end
if imgui.Button(u8'Анимации') then
sampSendChat("/anim")
end
if imgui.Button(u8'Меню сервера') then
sampSendChat("/mm")
end
if imgui.Button(u8'Помощь по серверу') then
sampSendChat("/help")
end
if imgui.Button(u8'Вставить/Вытащить ключи из машины') then
sampSendChat("/key")
end
if imgui.Button(u8'Открыть/Закрыть машину') then
sampSendChat("/lock")
end
if imgui.Button(u8'Надеть/Снять бронежилет') then
sampSendChat("/armour")
end
if imgui.Button(u8'Донат меню') then
sampSendChat("/donate")
end
if imgui.Button(u8'Посмотреть на время') then
sampSendChat("/time")
end
if imgui.Button(u8'Использовать наркотики') then
sampSendChat("/usedrugs 3")
end
end
imgui.Separator()
imgui.Text(u8(string.format('Время и дата: %s', os.date())))
imgui.Separator()
imgui.Text('HP: '..getCharHealth(playerPed)..'\nArmour:  '..getCharArmour(playerPed))
imgui.Separator()
x, y, z = getCharCoordinates(PLAYER_PED)
imgui.Text(u8"Позиция игрока : X:" .. math.floor(x) .. " | Y:" .. math.floor(y) .. " | Z:" .. math.floor(z))
imgui.Separator()
imgui.Text(u8'Приятной игры на Arizona RP!')
imgui.Separator()
if imgui.CollapsingHeader(u8"Автор скрипта") then
    imgui.Text(u8'Автор скрипта HaDeR')
    imgui.Separator()
    imgui.Text(u8"Автор биндера на Blasthack:")
    imgui.SameLine()
    imgui.Link("https://www.blast.hk/members/471740/")
    imgui.Separator()
    imgui.Text(u8"Автор биндера в Vk:")
    imgui.SameLine()
    imgui.Link("https://vk.com/u.hader")
    imgui.Separator()
    imgui.Text(u8"Дискорд автора:")
    imgui.SameLine()
    imgui.Link("Hader#2875")
    imgui.Separator()
end
imgui.Separator()
if imgui.CollapsingHeader(u8"Темы") then
    imgui.Text(u8"Пока что тем нет, будут доступны после обновы :(")
end
imgui.Separator()
if imgui.Button(u8"Отчистить чат") then
    memory.fill(sampGetChatInfoPtr() + 306, 0x0, 25200)
    memory.write(sampGetChatInfoPtr() + 306, 25562, 4, 0x0)
    memory.write(sampGetChatInfoPtr() + 0x63DA, 1, 1)
    sampAddChatMessage("{00CED1}Чат отчистен.", -1)
end
imgui.SameLine(200)
if imgui.Button(u8"Перезагрузить скрипт") then
    thisScript():reload() sampAddChatMessage("Скрипт перезагружен.", -1)
end
imgui.Separator()
imgui.Text(u8"Версия скрипта: 0.3 (Test vesion)")
imgui.Separator()
imgui.End()
end
end
function main()
while true do
wait(0)
if wasKeyPressed(key.VK_X) and not sampIsCursorActive() then
main_window_state.v = not main_window_state.v
end
imgui.Process = main_window_state.v
end
end
 

Sidney31

Известный
1,124
385
Lua:
function style()
    style.Alpha = 1.0
    style.ChildWindowRounding = 3
    style.WindowRounding = 3
    style.GrabRounding = 1
    style.GrabMinSize = 20
    style.FrameRounding = 3

    colors[clr.Text] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.TextDisabled] = ImVec4(0.00, 0.40, 0.41, 1.00)
    colors[clr.WindowBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
    colors[clr.ChildWindowBg] = ImVec4(0.00, 0.00, 0.00, 0.00)
    colors[clr.Border] = ImVec4(0.00, 1.00, 1.00, 0.65)
    colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
    colors[clr.FrameBg] = ImVec4(0.44, 0.80, 0.80, 0.18)
    colors[clr.FrameBgHovered] = ImVec4(0.44, 0.80, 0.80, 0.27)
    colors[clr.FrameBgActive] = ImVec4(0.44, 0.81, 0.86, 0.66)
    colors[clr.TitleBg] = ImVec4(0.14, 0.18, 0.21, 0.73)
    colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.54)
    colors[clr.TitleBgActive] = ImVec4(0.00, 1.00, 1.00, 0.27)
    colors[clr.MenuBarBg] = ImVec4(0.00, 0.00, 0.00, 0.20)
    colors[clr.ScrollbarBg] = ImVec4(0.22, 0.29, 0.30, 0.71)
    colors[clr.ScrollbarGrab] = ImVec4(0.00, 1.00, 1.00, 0.44)
    colors[clr.ScrollbarGrabHovered] = ImVec4(0.00, 1.00, 1.00, 0.74)
    colors[clr.ScrollbarGrabActive] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.ComboBg] = ImVec4(0.16, 0.24, 0.22, 0.60)
    colors[clr.CheckMark] = ImVec4(0.00, 1.00, 1.00, 0.68)
    colors[clr.SliderGrab] = ImVec4(0.00, 1.00, 1.00, 0.36)
    colors[clr.SliderGrabActive] = ImVec4(0.00, 1.00, 1.00, 0.76)
    colors[clr.Button] = ImVec4(0.00, 0.65, 0.65, 0.46)
    colors[clr.ButtonHovered] = ImVec4(0.01, 1.00, 1.00, 0.43)
    colors[clr.ButtonActive] = ImVec4(0.00, 1.00, 1.00, 0.62)
    colors[clr.Header] = ImVec4(0.00, 1.00, 1.00, 0.33)
    colors[clr.HeaderHovered] = ImVec4(0.00, 1.00, 1.00, 0.42)
    colors[clr.HeaderActive] = ImVec4(0.00, 1.00, 1.00, 0.54)
    colors[clr.ResizeGrip] = ImVec4(0.00, 1.00, 1.00, 0.54)
    colors[clr.ResizeGripHovered] = ImVec4(0.00, 1.00, 1.00, 0.74)
    colors[clr.ResizeGripActive] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.CloseButton] = ImVec4(0.00, 0.78, 0.78, 0.35)
    colors[clr.CloseButtonHovered] = ImVec4(0.00, 0.78, 0.78, 0.47)
    colors[clr.CloseButtonActive] = ImVec4(0.00, 0.78, 0.78, 1.00)
    colors[clr.PlotLines] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.PlotLinesHovered] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.PlotHistogram] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.PlotHistogramHovered] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.TextSelectedBg] = ImVec4(0.00, 1.00, 1.00, 0.22)
    colors[clr.ModalWindowDarkening] = ImVec4(0.04, 0.10, 0.09, 0.51)
end

style()
 

Hader

Потрачен
Автор темы
37
3
Обратите внимание, пользователь заблокирован на форуме. Не рекомендуется проводить сделки.
н
Lua:
function style()
    style.Alpha = 1.0
    style.ChildWindowRounding = 3
    style.WindowRounding = 3
    style.GrabRounding = 1
    style.GrabMinSize = 20
    style.FrameRounding = 3

    colors[clr.Text] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.TextDisabled] = ImVec4(0.00, 0.40, 0.41, 1.00)
    colors[clr.WindowBg] = ImVec4(0.00, 0.00, 0.00, 1.00)
    colors[clr.ChildWindowBg] = ImVec4(0.00, 0.00, 0.00, 0.00)
    colors[clr.Border] = ImVec4(0.00, 1.00, 1.00, 0.65)
    colors[clr.BorderShadow] = ImVec4(0.00, 0.00, 0.00, 0.00)
    colors[clr.FrameBg] = ImVec4(0.44, 0.80, 0.80, 0.18)
    colors[clr.FrameBgHovered] = ImVec4(0.44, 0.80, 0.80, 0.27)
    colors[clr.FrameBgActive] = ImVec4(0.44, 0.81, 0.86, 0.66)
    colors[clr.TitleBg] = ImVec4(0.14, 0.18, 0.21, 0.73)
    colors[clr.TitleBgCollapsed] = ImVec4(0.00, 0.00, 0.00, 0.54)
    colors[clr.TitleBgActive] = ImVec4(0.00, 1.00, 1.00, 0.27)
    colors[clr.MenuBarBg] = ImVec4(0.00, 0.00, 0.00, 0.20)
    colors[clr.ScrollbarBg] = ImVec4(0.22, 0.29, 0.30, 0.71)
    colors[clr.ScrollbarGrab] = ImVec4(0.00, 1.00, 1.00, 0.44)
    colors[clr.ScrollbarGrabHovered] = ImVec4(0.00, 1.00, 1.00, 0.74)
    colors[clr.ScrollbarGrabActive] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.ComboBg] = ImVec4(0.16, 0.24, 0.22, 0.60)
    colors[clr.CheckMark] = ImVec4(0.00, 1.00, 1.00, 0.68)
    colors[clr.SliderGrab] = ImVec4(0.00, 1.00, 1.00, 0.36)
    colors[clr.SliderGrabActive] = ImVec4(0.00, 1.00, 1.00, 0.76)
    colors[clr.Button] = ImVec4(0.00, 0.65, 0.65, 0.46)
    colors[clr.ButtonHovered] = ImVec4(0.01, 1.00, 1.00, 0.43)
    colors[clr.ButtonActive] = ImVec4(0.00, 1.00, 1.00, 0.62)
    colors[clr.Header] = ImVec4(0.00, 1.00, 1.00, 0.33)
    colors[clr.HeaderHovered] = ImVec4(0.00, 1.00, 1.00, 0.42)
    colors[clr.HeaderActive] = ImVec4(0.00, 1.00, 1.00, 0.54)
    colors[clr.ResizeGrip] = ImVec4(0.00, 1.00, 1.00, 0.54)
    colors[clr.ResizeGripHovered] = ImVec4(0.00, 1.00, 1.00, 0.74)
    colors[clr.ResizeGripActive] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.CloseButton] = ImVec4(0.00, 0.78, 0.78, 0.35)
    colors[clr.CloseButtonHovered] = ImVec4(0.00, 0.78, 0.78, 0.47)
    colors[clr.CloseButtonActive] = ImVec4(0.00, 0.78, 0.78, 1.00)
    colors[clr.PlotLines] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.PlotLinesHovered] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.PlotHistogram] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.PlotHistogramHovered] = ImVec4(0.00, 1.00, 1.00, 1.00)
    colors[clr.TextSelectedBg] = ImVec4(0.00, 1.00, 1.00, 0.22)
    colors[clr.ModalWindowDarkening] = ImVec4(0.04, 0.10, 0.09, 0.51)
end

style()
Не помогло