Исходник [mimgui] Font Awesome 6

ChаtGPT

Активный
402
96
Такая же фигня. @chapo Хелп :3

Код:
[ML] (error) faw.lua: ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1395: stack overflow
stack traceback:
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1395: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...Rk20kkzHol3gPg\samp03\moonloader\lib\fAwesome6_solid.lua:1403: in function '__index'
    ...ing\polyIb3664FfRk20kkzHol3gPg\samp03\moonloader\faw.lua:24: in function '_draw'
    ...64FfRk20kkzHol3gPg\samp03\moonloader\lib\mimgui\init.lua:107: in function <...64FfRk20kkzHol3gPg\samp03\moonloader\lib\mimgui\init.lua:91>
[ML] (error) faw.lua: Script died due to an error. (4CE91DD4)
тут не экстрасенсы, без кода никто не поможет. Всё что известно, это ошибка stack overflow, где-то цикл ебашит и переполняет стек
 

Daniel_Govnocode

Активный
315
58
тут не экстрасенсы, без кода никто не поможет. Всё что известно, это ошибка stack overflow, где-то цикл ебашит и переполняет стек
Lua:
local faicons = require("fAwesome6_solid")
local imgui = require("mimgui")

local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local new = imgui.new
local renderWindow = new.bool(false)

imgui.OnInitialize(function()
    faicons.Init()
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)
        imgui.Begin(u8'FAwesome 6', renderWindow)
        for i, v in pairs(faicons) do
            imgui.Text(faicons[v])
        end
        imgui.End()
    end
)

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('faw', function()
        renderWindow[0] = not renderWindow[0]
    end)
    while true do
        wait(0)
        
    end
end
 

chromiusj

$IWishYouSweetDreams
Модератор
5,721
4,012
Lua:
local faicons = require("fAwesome6_solid")
local imgui = require("mimgui")

local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local new = imgui.new
local renderWindow = new.bool(false)

imgui.OnInitialize(function()
    faicons.Init()
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)
        imgui.Begin(u8'FAwesome 6', renderWindow)
        for i, v in pairs(faicons) do
            imgui.Text(faicons[v])
        end
        imgui.End()
    end
)

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('faw', function()
        renderWindow[0] = not renderWindow[0]
    end)
    while true do
        wait(0)
       
    end
end
посмотри как тут реализовано подключение
 
  • Нравится
Реакции: ChаtGPT

Daniel_Govnocode

Активный
315
58
посмотри как тут реализовано подключение
Lua:
local faicons = require("fAwesome6_solid")
local imgui = require("mimgui")

local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local new = imgui.new
local renderWindow = new.bool(false)

imgui.OnInitialize(function()
    local config = imgui.ImFontConfig()
    config.MergeMode = true
    config.PixelSnapH = true
    iconRanges = imgui.new.ImWchar[3](faicons.min_range, faicons.max_range, 0)
    imgui.GetIO().Fonts:AddFontFromMemoryCompressedBase85TTF(faicons.get_font_data_base85('solid'), 14, config, iconRanges)
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)
        imgui.Begin(u8'FAwesome 6', renderWindow)
        for i, v in pairs(faicons) do
            imgui.Text(faicons[v])
        end
        imgui.End()
    end
)

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('faw', function()
        renderWindow[0] = not renderWindow[0]
    end)
    while true do
        wait(0)
       
    end
end

Все равно скрипт крашит
 

chromiusj

$IWishYouSweetDreams
Модератор
5,721
4,012
Lua:
local faicons = require("fAwesome6_solid")
local imgui = require("mimgui")

local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local new = imgui.new
local renderWindow = new.bool(false)

imgui.OnInitialize(function()
    local config = imgui.ImFontConfig()
    config.MergeMode = true
    config.PixelSnapH = true
    iconRanges = imgui.new.ImWchar[3](faicons.min_range, faicons.max_range, 0)
    imgui.GetIO().Fonts:AddFontFromMemoryCompressedBase85TTF(faicons.get_font_data_base85('solid'), 14, config, iconRanges)
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)
        imgui.Begin(u8'FAwesome 6', renderWindow)
        for i, v in pairs(faicons) do
            imgui.Text(faicons[v])
        end
        imgui.End()
    end
)

function main()
    while not isSampAvailable() do wait(0) end
    sampRegisterChatCommand('faw', function()
        renderWindow[0] = not renderWindow[0]
    end)
    while true do
        wait(0)
      
    end
end

Все равно скрипт крашит
1730312975937.png

ты же и так в инициализации окна, указываешь какие иконки будешь использовать, зачем в реквайре это