cannot resume non-suspended coroutine

Dewize

Известный
Автор темы
438
89
Версия MoonLoader
.026-beta
Сделал авто подкачку либ. Раньше работало, а щас нет.

FamCapt Helper: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'renderFontDrawText'
H:\Edik\SAMP\a\moonloader\FamCaptHelper_v.2.4.0 .lua:584: in function <H:\Edik\SAMP\a\moonloader\FamCaptHelper_v.2.4.0 .lua:396>
[01:13:46.006460] (error) FamCapt Helper: Script died due to an error. (0D02D45C)


Код:
function main

    if checkData() then
        Check_cfg()
        lua_thread.create(loadfont)
    end

end


function checkData()
    local bRes_Font = doesFileExist(getWorkingDirectory()..'\\resource\\fonts\\fa-solid-900.ttf')
    if not  bRes_Font then
        createDirectory(getWorkingDirectory()..'\\resource\\fonts')
        sampAddChatMessage(tag..'Отсутвуют некоторые файлы. Начало загрузки..', -1)
        lua_thread.create(function()
            downloadFile('fa-solid-900', getWorkingDirectory()..'\\resource\\fonts\\fa-solid-900.ttf', 'https://raw.githubusercontent.com/FamScript/FamScript/main/files/fa-solid-900.ttf')
            wait(100) sampAddChatMessage(tag..'Все нужные для работы файлы загружены. Перезагружаюсь..', -1)
            imgui.Process = false
            wait(200) thisScript():reload()
        end)
        return false
    end
    return true
end



function downloadFile(name, path, link) -- Обязательно использовать в потоке!
    if not doesFileExist(path) then
        local At = os.time()
        downloadUrlToFile(link, path, function(id, status, p1, p2)
            if status then
                print('status: '..status)
            end
            if status == dlstatus.STATUS_ENDDOWNLOADDATA then
                sampAddChatMessage(tag..'Файл «'..name..'»'..green..' загружен!', -1)
            end
            if status == dlstatus.STATUS_ENDDOWNLOAD and not doesFileExist(path) then
                sampfuncsLog('\n——————————————————————————————————————————————————————————————————————')
                sampfuncsLog(tag..'>> {FFFFFF} Не удалось скачать файл: «'..red..name..white..'»!')
                sampfuncsLog(tag..'>> {FFFFFF} Сообщить о проблеме: '..white..'vk.com/riko_costa')
                sampfuncsLog('——————————————————————————————————————————————————————————————————————\n')
            end
        end)
        while not doesFileExist(path) do wait(0)
            if os.time() - At >= 10 then
                sampfuncsLog(tag..'>> {FFFFFF} Тайм-аут ожидания скачивания файла: «'..red..name..white..'»')
                break
            end
        end
    end
end
 

RedHolms

Известный
Проверенный
618
360
Сделал авто подкачку либ. Раньше работало, а щас нет.

FamCapt Helper: cannot resume non-suspended coroutine
stack traceback:
[C]: in function 'renderFontDrawText'
H:\Edik\SAMP\a\moonloader\FamCaptHelper_v.2.4.0 .lua:584: in function <H:\Edik\SAMP\a\moonloader\FamCaptHelper_v.2.4.0 .lua:396>
[01:13:46.006460] (error) FamCapt Helper: Script died due to an error. (0D02D45C)


Код:
function main

    if checkData() then
        Check_cfg()
        lua_thread.create(loadfont)
    end

end


function checkData()
    local bRes_Font = doesFileExist(getWorkingDirectory()..'\\resource\\fonts\\fa-solid-900.ttf')
    if not  bRes_Font then
        createDirectory(getWorkingDirectory()..'\\resource\\fonts')
        sampAddChatMessage(tag..'Отсутвуют некоторые файлы. Начало загрузки..', -1)
        lua_thread.create(function()
            downloadFile('fa-solid-900', getWorkingDirectory()..'\\resource\\fonts\\fa-solid-900.ttf', 'https://raw.githubusercontent.com/FamScript/FamScript/main/files/fa-solid-900.ttf')
            wait(100) sampAddChatMessage(tag..'Все нужные для работы файлы загружены. Перезагружаюсь..', -1)
            imgui.Process = false
            wait(200) thisScript():reload()
        end)
        return false
    end
    return true
end



function downloadFile(name, path, link) -- Обязательно использовать в потоке!
    if not doesFileExist(path) then
        local At = os.time()
        downloadUrlToFile(link, path, function(id, status, p1, p2)
            if status then
                print('status: '..status)
            end
            if status == dlstatus.STATUS_ENDDOWNLOADDATA then
                sampAddChatMessage(tag..'Файл «'..name..'»'..green..' загружен!', -1)
            end
            if status == dlstatus.STATUS_ENDDOWNLOAD and not doesFileExist(path) then
                sampfuncsLog('\n——————————————————————————————————————————————————————————————————————')
                sampfuncsLog(tag..'>> {FFFFFF} Не удалось скачать файл: «'..red..name..white..'»!')
                sampfuncsLog(tag..'>> {FFFFFF} Сообщить о проблеме: '..white..'vk.com/riko_costa')
                sampfuncsLog('——————————————————————————————————————————————————————————————————————\n')
            end
        end)
        while not doesFileExist(path) do wait(0)
            if os.time() - At >= 10 then
                sampfuncsLog(tag..'>> {FFFFFF} Тайм-аут ожидания скачивания файла: «'..red..name..white..'»')
                break
            end
        end
    end
end
мейби фулл код скинешь, а не отрывок не связанного с ошибкой кода?
 

sat0ry

Известный
1,087
290
В логе ошибка с renderFontDrawText, а код, который ты скинул там его нет.

IMG_20220724_022843.jpg
 

Dewize

Известный
Автор темы
438
89
Код:
--"Армор таймер" в действии--
        if armor_timer_imgui.v then
            if 60-(os.time()-kd_armour) > 0 then
                renderFontDrawText(myfont, 60-(os.time()-kd_armour)..' '..red..'armour', atposx, atposy-atfontsize.v*1.3, 0xFFFFFFFF)
            else
                renderFontDrawText(myfont, green..'armour', atposx, atposy-atfontsize.v*1.3, 0xFFFFFFFF)
            end
        end

Вот