Из-за чего крашит?

Tensay

Активный
Автор темы
169
51
Версия MoonLoader
.026-beta
Из-за чего крашит?
Abeme:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    local checking = checklibs()
        while not checking do
            wait(200)
        end
    while true do
        wait(0)
    end
end

function checklibs()
    local function DownloadFile(url, file)
        downloadUrlToFile(url,file,function(id,status)
        if status == dlstatus.STATUSEX_ENDDOWNLOAD then
        end
        end)
        while not doesFileExist(file) do
        wait(1000)
        end
    end
    if not doesFileExist(getWorkingDirectory() .. "/resource/fonts/fa-solid-900.ttf") then
        sms("Отсутствует файл шрифта fa-solid-900.ttf. Пытаюсь его установить.")
        createDirectory(getWorkingDirectory() .. "/resource/fonts/")
        DownloadFile('https://github.com/FortAwesome/Font-Awesome/raw/master/webfonts/fa-solid-900.ttf', getWorkingDirectory().."/resource/fonts/fa-solid-900.ttf")
        sms('Шрифт "fa-solid-900.ttf" готов! Перезапускаю скрипт.')
        thisScript():reload()
    end
    return
end
 
Решение
Из-за чего крашит?
Abeme:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    local checking = checklibs()
        while not checking do
            wait(200)
        end
    while true do
        wait(0)
    end
end

function checklibs()
    local function DownloadFile(url, file)
        downloadUrlToFile(url,file,function(id,status)
        if status == dlstatus.STATUSEX_ENDDOWNLOAD then
        end
        end)
        while not doesFileExist(file) do
        wait(1000)
        end
    end
    if not doesFileExist(getWorkingDirectory() .. "/resource/fonts/fa-solid-900.ttf") then
        sms("Отсутствует файл шрифта fa-solid-900.ttf. Пытаюсь...

Rice.

Известный
Модератор
1,692
1,458
Из-за чего крашит?
Abeme:
function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end
    local checking = checklibs()
        while not checking do
            wait(200)
        end
    while true do
        wait(0)
    end
end

function checklibs()
    local function DownloadFile(url, file)
        downloadUrlToFile(url,file,function(id,status)
        if status == dlstatus.STATUSEX_ENDDOWNLOAD then
        end
        end)
        while not doesFileExist(file) do
        wait(1000)
        end
    end
    if not doesFileExist(getWorkingDirectory() .. "/resource/fonts/fa-solid-900.ttf") then
        sms("Отсутствует файл шрифта fa-solid-900.ttf. Пытаюсь его установить.")
        createDirectory(getWorkingDirectory() .. "/resource/fonts/")
        DownloadFile('https://github.com/FortAwesome/Font-Awesome/raw/master/webfonts/fa-solid-900.ttf', getWorkingDirectory().."/resource/fonts/fa-solid-900.ttf")
        sms('Шрифт "fa-solid-900.ttf" готов! Перезапускаю скрипт.')
        thisScript():reload()
    end
    return
end
Lua:
local dlstatus = require "moonloader".download_status
function checklibs()
    local function DownloadFile(url, file)
        downloadUrlToFile(url,file,function(id,status)
        if status == dlstatus.STATUSEX_ENDDOWNLOAD then
        end
        end)
        while not doesFileExist(file) do
        wait(1000)
        end
    end
    if not doesFileExist(getWorkingDirectory() .. "/resource/fonts/fa-solid-900.ttf") then
        sms("Отсутствует файл шрифта fa-solid-900.ttf. Пытаюсь его установить.")
        createDirectory(getWorkingDirectory() .. "/resource/fonts/")
        DownloadFile('https://github.com/FortAwesome/Font-Awesome/raw/master/webfonts/fa-solid-900.ttf', getWorkingDirectory().."/resource/fonts/fa-solid-900.ttf")
        sms('Шрифт "fa-solid-900.ttf" готов! Перезапускаю скрипт.')
        thisScript():reload()
        return false
    end
    return true
end