пак falcons

Kegwineye.

Участник
Автор темы
478
21
Или из-за чего это


[ML] (error) newtesthelperformclv.lua: ...TA-SA\GTA for Low PC\moonloader\newtesthelperformclv.lua:8: module 'falcons' not found:
no field package.preload['falcons']
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons.lua'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons\init.lua'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\falcons.lua'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\falcons\init.lua'
no file '.\falcons.lua'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons.luac'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons\init.luac'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\falcons.luac'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\falcons\init.luac'
no file '.\falcons.luac'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons.dll'
stack traceback:
[C]: in function 'require'
...TA-SA\GTA for Low PC\moonloader\newtesthelperformclv.lua:8: in main chunk
[ML] (error) newtesthelperformclv.lua: Script died due to an error. (0BDEDAFC)

Или из-за чего это


[ML] (error) newtesthelperformclv.lua: ...TA-SA\GTA for Low PC\moonloader\newtesthelperformclv.lua:8: module 'falcons' not found:
no field package.preload['falcons']
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons.lua'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons\init.lua'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\falcons.lua'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\falcons\init.lua'
no file '.\falcons.lua'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons.luac'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons\init.luac'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\falcons.luac'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\falcons\init.luac'
no file '.\falcons.luac'
no file 'C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\falcons.dll'
stack traceback:
[C]: in function 'require'
...TA-SA\GTA for Low PC\moonloader\newtesthelperformclv.lua:8: in main chunk
[ML] (error) newtesthelperformclv.lua: Script died due to an error. (0BDEDAFC)
@Rice.
 
Решение
У меня теперь показывает вместо иконки, вопрос. Как исправить ?

@chapo



Код:
[ML] (error) newtesthelperformclv.lua: C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:965: stack overflow
stack traceback:
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:965: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'...

Kegwineye.

Участник
Автор темы
478
21
@chapo

[ML] (error) newtesthelperformclv.lua: C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:704: stack overflow
stack traceback:
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:704: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
...
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\faIcons.lua:712: in function '__index'
...TA-SA\GTA for Low PC\moonloader\newtesthelperformclv.lua:55: in function 'OnDrawFrame'
 

Kegwineye.

Участник
Автор темы
478
21
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'C1251'
u8 = encoding.UTF8

local fa = require 'faIcons'
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256) -- Зачем тебе он тут если нету ImGui.InputText(name, buffer)

local style = imgui.GetStyle()
style.FrameRounding = 5.0

function imgui.BeforeDrawFlame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig()
        font_config.MergeMode = true
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fontawesome-webfont.ttf', 14.0, font_config, fa_glyph_ranges)-- body
    end 
end

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

    sampRegisterChatCommand("imgui", cmdimgui)

    handle, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    imgui.Process = false -- его можно вынести до функции при желании

  while true do
        wait(0)

        if main_window_state.v == false then
        imgui.Process = false -- зачем тебе их два?
        imgui.ShowCursor = true
        end
    end
end -- добавил ещё end который закрывает функцию маин
function cmdimgui() -- не правильный аргумент cmd_imgui заменен на cmdimgui и тут не обязательно вписывать (arg) можно обойтись и ()
     main_window_state.v = not main_window_state.v
     imgui.Process = main_window_state.v
 end
 
function imgui.OnDrawFrame() -- не Flame а Frame!!


     imgui.Begin("Start imgui", main_window_state)
imgui.BeginChild("##left", imgui.ImVec2(195, 175), true)
if imgui.Button('Menu', imgui.ImVec2(180, 50)) then menu = 1 end
if imgui.Button(fa.ICON_FA_USER_COG .. ' Settings', imgui.ImVec2(180, 50)) then menu = 2 end
if imgui.Button('Author', imgui.ImVec2(180, 50)) then menu = 3 end
imgui.EndChild()

imgui.SameLine()

imgui.BeginChild("##right", imgui.ImVec2(700, 450), true)
if menu == 1 then
    imgui.Text('Menu', imgui.ImVec2(180, 50))
end
if menu == 2 then
    imgui.Text('Settings')
end
if menu == 3 then
    imgui.Text('Author')
end
imgui.EndChild()
     imgui.End()
    end
-- end он тут не нужен
 

Вложения

  • newtesthelperformclv.lua
    2.3 KB · Просмотры: 18

chapo

tg/inst: @moujeek
Всефорумный модератор
9,232
12,645
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'C1251'
u8 = encoding.UTF8

local fa = require 'faIcons'
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256) -- Зачем тебе он тут если нету ImGui.InputText(name, buffer)

local style = imgui.GetStyle()
style.FrameRounding = 5.0

function imgui.BeforeDrawFlame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig()
        font_config.MergeMode = true
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fontawesome-webfont.ttf', 14.0, font_config, fa_glyph_ranges)-- body
    end
end

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

    sampRegisterChatCommand("imgui", cmdimgui)

    handle, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    imgui.Process = false -- его можно вынести до функции при желании

  while true do
        wait(0)

        if main_window_state.v == false then
        imgui.Process = false -- зачем тебе их два?
        imgui.ShowCursor = true
        end
    end
end -- добавил ещё end который закрывает функцию маин
function cmdimgui() -- не правильный аргумент cmd_imgui заменен на cmdimgui и тут не обязательно вписывать (arg) можно обойтись и ()
     main_window_state.v = not main_window_state.v
     imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame() -- не Flame а Frame!!


     imgui.Begin("Start imgui", main_window_state)
imgui.BeginChild("##left", imgui.ImVec2(195, 175), true)
if imgui.Button('Menu', imgui.ImVec2(180, 50)) then menu = 1 end
if imgui.Button(fa.ICON_FA_USER_COG .. ' Settings', imgui.ImVec2(180, 50)) then menu = 2 end
if imgui.Button('Author', imgui.ImVec2(180, 50)) then menu = 3 end
imgui.EndChild()

imgui.SameLine()

imgui.BeginChild("##right", imgui.ImVec2(700, 450), true)
if menu == 1 then
    imgui.Text('Menu', imgui.ImVec2(180, 50))
end
if menu == 2 then
    imgui.Text('Settings')
end
if menu == 3 then
    imgui.Text('Author')
end
imgui.EndChild()
     imgui.End()
    end
-- end он тут не нужен
такой иконки нет
1637152987614.png

и в fa4 иконки надо указывать так: fa.ICON_USER (без _FA_)
 

Kegwineye.

Участник
Автор темы
478
21
У меня теперь показывает вместо иконки, вопрос. Как исправить ?

@chapo



Код:
[ML] (error) newtesthelperformclv.lua: C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:965: stack overflow
stack traceback:
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:965: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    ...
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    ...TA-SA\GTA for Low PC\moonloader\newtesthelperformclv.lua:59: in function 'OnDrawFrame'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\imgui.lua:1378: in function <C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\imgui.lua:1367>
[ML] (error) newtesthelperformclv.lua: Script died due to an error. (1702868C)


Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'C1251'
u8 = encoding.UTF8

local fa = require 'fAwesome5'

show_main_window = imgui.ImBool(false)

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256) -- Зачем тебе он тут если нету ImGui.InputText(name, buffer)

local style = imgui.GetStyle()
style.FrameRounding = 5.0

local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
        font_config.MergeMode = true
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
        end
end


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

    sampRegisterChatCommand("imgui", cmdimgui)

    handle, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    imgui.Process = false -- его можно вынести до функции при желании

  while true do
        wait(0)

        if main_window_state.v == false then
        imgui.Process = false -- зачем тебе их два?
        imgui.ShowCursor = true
        end
    end
end -- добавил ещё end который закрывает функцию маин
function cmdimgui() -- не правильный аргумент cmd_imgui заменен на cmdimgui и тут не обязательно вписывать (arg) можно обойтись и ()
     main_window_state.v = not main_window_state.v
     imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame() -- не Flame а Frame!!


     imgui.Begin("Start imgui",  show_main_window, imgui.WindowFlags.NoCollapse)
imgui.BeginChild("##left", imgui.ImVec2(195, 175), true)
if imgui.Button(fa.ICON_BARS .. ' Menu', imgui.ImVec2(180, 50)) then menu = 1 end
if imgui.Button(fa.ICON_FA_LAPTOP .. ' Settings', imgui.ImVec2(180, 50)) then menu = 2 end
if imgui.Button('Author', imgui.ImVec2(180, 50)) then menu = 3 end
imgui.EndChild()

imgui.SameLine()

imgui.BeginChild("##right", imgui.ImVec2(700, 450), true)
if menu == 1 then
    imgui.Text('Menu', imgui.ImVec2(180, 50))
end
if menu == 2 then
    imgui.Text('Settings')
end
if menu == 3 then
    imgui.Text('Author')
end
imgui.EndChild()
     imgui.End()
    end
-- end он тут не нужен
 
Последнее редактирование:

chapo

tg/inst: @moujeek
Всефорумный модератор
9,232
12,645
У меня теперь показывает вместо иконки, вопрос. Как исправить ?

@chapo



Код:
[ML] (error) newtesthelperformclv.lua: C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:965: stack overflow
stack traceback:
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:965: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    ...
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\fAwesome5.lua:973: in function '__index'
    ...TA-SA\GTA for Low PC\moonloader\newtesthelperformclv.lua:59: in function 'OnDrawFrame'
    C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\imgui.lua:1378: in function <C:\Games\GTA-SA\GTA for Low PC\moonloader\lib\imgui.lua:1367>
[ML] (error) newtesthelperformclv.lua: Script died due to an error. (1702868C)


Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'C1251'
u8 = encoding.UTF8

local fa = require 'fAwesome5'

show_main_window = imgui.ImBool(false)

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256) -- Зачем тебе он тут если нету ImGui.InputText(name, buffer)

local style = imgui.GetStyle()
style.FrameRounding = 5.0

local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
        font_config.MergeMode = true
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
        end
end


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

    sampRegisterChatCommand("imgui", cmdimgui)

    handle, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    imgui.Process = false -- его можно вынести до функции при желании

  while true do
        wait(0)

        if main_window_state.v == false then
        imgui.Process = false -- зачем тебе их два?
        imgui.ShowCursor = true
        end
    end
end -- добавил ещё end который закрывает функцию маин
function cmdimgui() -- не правильный аргумент cmd_imgui заменен на cmdimgui и тут не обязательно вписывать (arg) можно обойтись и ()
     main_window_state.v = not main_window_state.v
     imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame() -- не Flame а Frame!!


     imgui.Begin("Start imgui",  show_main_window, imgui.WindowFlags.NoCollapse)
imgui.BeginChild("##left", imgui.ImVec2(195, 175), true)
if imgui.Button(fa.ICON_BARS .. ' Menu', imgui.ImVec2(180, 50)) then menu = 1 end
if imgui.Button(fa.ICON_FA_LAPTOP .. ' Settings', imgui.ImVec2(180, 50)) then menu = 2 end
if imgui.Button('Author', imgui.ImVec2(180, 50)) then menu = 3 end
imgui.EndChild()

imgui.SameLine()

imgui.BeginChild("##right", imgui.ImVec2(700, 450), true)
if menu == 1 then
    imgui.Text('Menu', imgui.ImVec2(180, 50))
end
if menu == 2 then
    imgui.Text('Settings')
end
if menu == 3 then
    imgui.Text('Author')
end
imgui.EndChild()
     imgui.End()
    end
-- end он тут не нужен
1637155201820.png

Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'C1251'
u8 = encoding.UTF8

local fa = require 'fAwesome5'

show_main_window = imgui.ImBool(false)

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256) -- Зачем тебе он тут если нету ImGui.InputText(name, buffer)

local style = imgui.GetStyle()
style.FrameRounding = 5.0

local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
        font_config.MergeMode = true
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
        end
end


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

    sampRegisterChatCommand("imgui", cmdimgui)

    handle, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    imgui.Process = false -- его можно вынести до функции при желании

  while true do
        wait(0)

        if main_window_state.v == false then
        imgui.Process = false -- зачем тебе их два?
        imgui.ShowCursor = true
        end
    end
end -- добавил ещё end который закрывает функцию маин
function cmdimgui() -- не правильный аргумент cmd_imgui заменен на cmdimgui и тут не обязательно вписывать (arg) можно обойтись и ()
     main_window_state.v = not main_window_state.v
     imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame() -- не Flame а Frame!!


     imgui.Begin("Start imgui",  show_main_window, imgui.WindowFlags.NoCollapse)
imgui.BeginChild("##left", imgui.ImVec2(195, 175), true)
if imgui.Button(fa.ICON_FA_BARS .. ' Menu', imgui.ImVec2(180, 50)) then menu = 1 end
if imgui.Button(fa.ICON_FA_LAPTOP .. ' Settings', imgui.ImVec2(180, 50)) then menu = 2 end
if imgui.Button('Author', imgui.ImVec2(180, 50)) then menu = 3 end
imgui.EndChild()

imgui.SameLine()

imgui.BeginChild("##right", imgui.ImVec2(700, 450), true)
if menu == 1 then
    imgui.Text('Menu', imgui.ImVec2(180, 50))
end
if menu == 2 then
    imgui.Text('Settings')
end
if menu == 3 then
    imgui.Text('Author')
end
imgui.EndChild()
     imgui.End()
    end
-- end он тут не нужен
 
  • Нравится
Реакции: Kegwineye.

Kegwineye.

Участник
Автор темы
478
21
Посмотреть вложение 122707
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'C1251'
u8 = encoding.UTF8

local fa = require 'fAwesome5'

show_main_window = imgui.ImBool(false)

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256) -- Зачем тебе он тут если нету ImGui.InputText(name, buffer)

local style = imgui.GetStyle()
style.FrameRounding = 5.0

local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
        font_config.MergeMode = true
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
        end
end


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

    sampRegisterChatCommand("imgui", cmdimgui)

    handle, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)

    imgui.Process = false -- его можно вынести до функции при желании

  while true do
        wait(0)

        if main_window_state.v == false then
        imgui.Process = false -- зачем тебе их два?
        imgui.ShowCursor = true
        end
    end
end -- добавил ещё end который закрывает функцию маин
function cmdimgui() -- не правильный аргумент cmd_imgui заменен на cmdimgui и тут не обязательно вписывать (arg) можно обойтись и ()
     main_window_state.v = not main_window_state.v
     imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame() -- не Flame а Frame!!


     imgui.Begin("Start imgui",  show_main_window, imgui.WindowFlags.NoCollapse)
imgui.BeginChild("##left", imgui.ImVec2(195, 175), true)
if imgui.Button(fa.ICON_FA_BARS .. ' Menu', imgui.ImVec2(180, 50)) then menu = 1 end
if imgui.Button(fa.ICON_FA_LAPTOP .. ' Settings', imgui.ImVec2(180, 50)) then menu = 2 end
if imgui.Button('Author', imgui.ImVec2(180, 50)) then menu = 3 end
imgui.EndChild()

imgui.SameLine()

imgui.BeginChild("##right", imgui.ImVec2(700, 450), true)
if menu == 1 then
    imgui.Text('Menu', imgui.ImVec2(180, 50))
end
if menu == 2 then
    imgui.Text('Settings')
end
if menu == 3 then
    imgui.Text('Author')
end
imgui.EndChild()
     imgui.End()
    end
-- end он тут не нужен
окно не закрывается, только сворачивается. Как исправить ?
 

chapo

tg/inst: @moujeek
Всефорумный модератор
9,232
12,645
окно не закрывается, только сворачивается. Как исправить ?
у тебя в imgui.Begin было указано неверное название переменной. Так же исправил табуляцию и подправил еще пару моментов
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'C1251'
u8 = encoding.UTF8

local fa = require 'fAwesome5'

show_main_window = imgui.ImBool(false)

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256) -- Зачем тебе он тут если нету ImGui.InputText(name, buffer)

local style = imgui.GetStyle()
style.FrameRounding = 5.0

local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
        font_config.MergeMode = true
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
        end
end


function main()
    while not isSampAvailable() do wait(100) end   
    sampRegisterChatCommand("imgui", function()
        main_window_state.v = not main_window_state.v
    end) 
    handle, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)   
    imgui.Process = false
    while true do
        wait(0)
        imgui.Process = main_window_state.v
    end
end

function imgui.OnDrawFrame()
    imgui.Begin("Start imgui",  main_window_state, imgui.WindowFlags.NoCollapse)
    imgui.BeginChild("##left", imgui.ImVec2(195, 175), true)
        if imgui.Button(fa.ICON_FA_BARS .. ' Menu', imgui.ImVec2(180, 50)) then menu = 1 end
        if imgui.Button(fa.ICON_FA_LAPTOP .. ' Settings', imgui.ImVec2(180, 50)) then menu = 2 end
        if imgui.Button('Author', imgui.ImVec2(180, 50)) then menu = 3 end
    imgui.EndChild()
    imgui.SameLine()
    imgui.BeginChild("##right", imgui.ImVec2(700, 450), true)
        if menu == 1 then
            imgui.Text('Menu', imgui.ImVec2(180, 50))
        end
        if menu == 2 then
            imgui.Text('Settings')
        end
        if menu == 3 then
            imgui.Text('Author')
        end
    imgui.EndChild()
    imgui.End()
end
 

Kegwineye.

Участник
Автор темы
478
21
у тебя в imgui.Begin было указано неверное название переменной. Так же исправил табуляцию и подправил еще пару моментов
Lua:
require "lib.moonloader"
local keys = require "vkeys"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'C1251'
u8 = encoding.UTF8

local fa = require 'fAwesome5'

show_main_window = imgui.ImBool(false)

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256) -- Зачем тебе он тут если нету ImGui.InputText(name, buffer)

local style = imgui.GetStyle()
style.FrameRounding = 5.0

local fa_font = nil
local fa_glyph_ranges = imgui.ImGlyphRanges({ fa.min_range, fa.max_range })
function imgui.BeforeDrawFrame()
    if fa_font == nil then
        local font_config = imgui.ImFontConfig() -- to use 'imgui.ImFontConfig.new()' on error
        font_config.MergeMode = true
        fa_font = imgui.GetIO().Fonts:AddFontFromFileTTF('moonloader/resource/fonts/fa-solid-900.ttf', 13.0, font_config, fa_glyph_ranges)
        end
end


function main()
    while not isSampAvailable() do wait(100) end  
    sampRegisterChatCommand("imgui", function()
        main_window_state.v = not main_window_state.v
    end)
    handle, id = sampGetPlayerIdByCharHandle(PLAYER_PED)
    nick = sampGetPlayerNickname(id)  
    imgui.Process = false
    while true do
        wait(0)
        imgui.Process = main_window_state.v
    end
end

function imgui.OnDrawFrame()
    imgui.Begin("Start imgui",  main_window_state, imgui.WindowFlags.NoCollapse)
    imgui.BeginChild("##left", imgui.ImVec2(195, 175), true)
        if imgui.Button(fa.ICON_FA_BARS .. ' Menu', imgui.ImVec2(180, 50)) then menu = 1 end
        if imgui.Button(fa.ICON_FA_LAPTOP .. ' Settings', imgui.ImVec2(180, 50)) then menu = 2 end
        if imgui.Button('Author', imgui.ImVec2(180, 50)) then menu = 3 end
    imgui.EndChild()
    imgui.SameLine()
    imgui.BeginChild("##right", imgui.ImVec2(700, 450), true)
        if menu == 1 then
            imgui.Text('Menu', imgui.ImVec2(180, 50))
        end
        if menu == 2 then
            imgui.Text('Settings')
        end
        if menu == 3 then
            imgui.Text('Author')
        end
    imgui.EndChild()
    imgui.End()
end
а что ты удалил, а то аж -15 строчек ?