не работает imgui

тудудудудуу

Активный
Автор темы
326
33
че делать если имгуи не работает, вот код
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require "imgui"
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local tag = "{Helper lovli}"
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

function main()
if not isSampLoaded() or not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end

sampRegisterChatCommand("imgui", cmd imgui)
_, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
nick = sampGetPlayerNickName(id)

imgui.Process = true



while true do
wait(100)




end
end

function cmd_imgui(arg)
main_window_state.v = not main_window_state.vkeys
imgui.Process = main_window_state.vkeys
end

function imgui.OnDrawFrame()
imgui.Begin("Start imgui")
imgui.Text("Helper lovli ")
imgui.End()
end

лог
 

Вложения

  • moonloader.log
    21.2 KB · Просмотры: 6
Решение
На:
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require "imgui"
local encoding = require "encoding"
encoding.default = "CP1251"
u8 = encoding.UTF8

local tag = "{Helper lovli}"
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

function main()
    while not isSampAvailable() do wait(0) end
    while not sampIsLocalPlayerSpawned() do wait(0) end

    sampRegisterChatCommand("imgui", cmd_imgui)
    _, id = sampGetPlayerIdByCharHandle(playerPed)
	nick = sampGetPlayerNickname(id)

    while true do wait(0)
        imgui.Process =...

тудудудудуу

Активный
Автор темы
326
33

Блять, кто вас код учил так вставлять?
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require "imgui"
local encoding = require "encoding"
encoding.default = "CP1251"
u8 = encoding.UTF8

local tag = "{Helper lovli}"
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

function main()
    while not isSampAvailable() do wait(0) end

    sampRegisterChatCommand("imgui", cmd_imgui)
    _, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickName(id)

    while true do wait(0)
        imgui.Process = main_window_state.v
    end
end

function cmd_imgui(arg)
    main_window_state.v = not main_window_state.v
end

function imgui.OnDrawFrame()
    if main_window_state.v then
        imgui.Begin("Start imgui")
        imgui.Text("Helper lovli ")
        imgui.End()
    end
end
21
 

Вложения

  • moonloader.log
    4.3 KB · Просмотры: 2
  • moonloader.log
    10 KB · Просмотры: 2

zTechnology

Известный
1,101
485
На:
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require "imgui"
local encoding = require "encoding"
encoding.default = "CP1251"
u8 = encoding.UTF8

local tag = "{Helper lovli}"
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

function main()
    while not isSampAvailable() do wait(0) end
    while not sampIsLocalPlayerSpawned() do wait(0) end

    sampRegisterChatCommand("imgui", cmd_imgui)
    _, id = sampGetPlayerIdByCharHandle(playerPed)
	nick = sampGetPlayerNickname(id)

    while true do wait(0)
        imgui.Process = main_window_state.v
    end
end

function cmd_imgui(arg)
    main_window_state.v = not main_window_state.v
end

function imgui.OnDrawFrame()
    if main_window_state.v then
        imgui.Begin("Start imgui")
        imgui.Text("Helper lovli ")
        imgui.End()
    end
end
 
Последнее редактирование:

тудудудудуу

Активный
Автор темы
326
33
На:
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require "imgui"
local encoding = require "encoding"
encoding.default = "CP1251"
u8 = encoding.UTF8

local tag = "{Helper lovli}"
local label = 0
local main_color = 0x5A90CE
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

function main()
    while not isSampAvailable() do wait(0) end
    while not sampIsLocalPlayerSpawned() do wait(0) end

    sampRegisterChatCommand("imgui", cmd_imgui)
    _, id = sampGetPlayerIdByCharHandle(playerPed)
    nick = sampGetPlayerNickname(id)

    while true do wait(0)
        imgui.Process = main_window_state.v
    end
end

function cmd_imgui(arg)
    main_window_state.v = not main_window_state.v
end

function imgui.OnDrawFrame()
    if main_window_state.v then
        imgui.Begin("Start imgui")
        imgui.Text("Helper lovli ")
        imgui.End()
    end
end
sps
 
  • Нравится
Реакции: zTechnology