проверка на существование шрифта

biscuitt

Известный
Автор темы
185
14
Версия MoonLoader
.026-beta
пользователь вводит в инпуттексте название шрифта. Как проверить то, существует ли данный шрифт в системе?
 
Решение
Попробуй может что выйдет

Lua:
local lfs = require("lfs")

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end 
        sampRegisterChatCommand('ch',function(arg)
            if arg:find('.+') then
                for entry in lfs.dir("C:\\Windows\\Fonts") do
                    local mode = lfs.attributes("./" .. entry, "mode")
                    if entry:find(arg) then
                        print(entry)
                    end
                    
                end
                print('-----------------------------------------------------------') -- для отделения
                sampAddChatMessage('Все',-1)
            else...

qdIbp

Автор темы
Проверенный
1,386
1,141
Попробуй может что выйдет

Lua:
local lfs = require("lfs")

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
    while not isSampAvailable() do wait(100) end 
        sampRegisterChatCommand('ch',function(arg)
            if arg:find('.+') then
                for entry in lfs.dir("C:\\Windows\\Fonts") do
                    local mode = lfs.attributes("./" .. entry, "mode")
                    if entry:find(arg) then
                        print(entry)
                    end
                    
                end
                print('-----------------------------------------------------------') -- для отделения
                sampAddChatMessage('Все',-1)
            else
                sampAddChatMessage('Вы нечего не ввели',-1)
            end
        end)
    wait(-1)
end
 
  • Нравится
Реакции: biscuitt