RedM Index logoRedM Index
NativesHashesClothesBlipsPropsItem Tool
Sign inGet started

Reference

  • Natives
  • Hashes
  • Clothes
  • Blips
  • Props

Namespace

  1. Reference
  2. Natives
  3. REQUEST_RESOURCE_FILE_SET

REQUEST_RESOURCE_FILE_SET

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.

CFX

Signature

lua
RequestResourceFileSet(setName)
-- returns BOOL

Parameters

NameTypeDescription
char*The name of the file set as specified in `fxmanifest.lua`.

Usage

Named call
RequestResourceFileSet(setName)
InvokeNative
Citizen.InvokeNative(0xE7490533, setName)
lua 1
-- 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)

Details

Hash
API set
Source
cfx

Source: cfx

On this page

  • Signature
  • Parameters
  • Usage
  • Details