Skip to content

RequestResourceFileSet ​

клиент REQUEST_RESOURCE_FILE_SET

c
BOOL REQUEST_RESOURCE_FILE_SET(char* setName);

Requests a resource file set with the specified name to be downloaded and mounted on top of the current resource.

Resource file sets are specified in fxmanifest.lua with the following syntax:

lua
file_set 'addon_ui' {
    'ui/addon/index.html',
    'ui/addon/**.js',
}

This command will trigger a script error if the request failed.

Параметры ​

  • setName: The name of the file set as specified in fxmanifest.lua.

Возвращает ​

TRUE if the set is mounted, FALSE if the request is still pending.

Примеры ​

lua
-- fxmanifest.lua
file_set 'dummies' {
    'dummy/**.txt',
    'potato.txt',
}

-- main script
local function PrintTest()
    local tests = { 'potato.txt', 'dummy/1.txt', 'dummy/b/2.txt' }

    for _, v in ipairs(tests) do
        local data = LoadResourceFile(GetCurrentResourceName(), v)
        print(v, data)
    end
end

RegisterCommand('fileset', function()
    PrintTest()

    while not RequestResourceFileSet('dummies') do
        Wait(100)
    end

    PrintTest()
end)

Страница собрана автоматически из native-decls/RequestResourceFileSet.md. Нашли ошибку — поправьте исходный файл.

Независимый проект на базе Cfx.re. Не связан с Rockstar Games и Take-Two Interactive.