# CFX::REQUEST_RESOURCE_FILE_SET

- **Hash:** `0xE7490533`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `RequestResourceFileSet`
- **Side:** client (Cfx runtime native)
- **Name status:** official
- **Documentation:** described with examples
- **URL:** https://natives.borderlinerp.com/natives/CFX/REQUEST_RESOURCE_FILE_SET

## Signature

```c
BOOL REQUEST_RESOURCE_FILE_SET(char* setName);
```

## Parameters

- `setName` (`char*`) — The name of the file set as specified in `fxmanifest.lua`.

## Returns

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

## Description

*Source: Cfx.re native reference*

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.

## Usage

### Lua

```lua
local retval = RequestResourceFileSet(setName)

-- always available, by hash
local retval = Citizen.InvokeNative(0xe7490533, setName, Citizen.ReturnResultAnyway())
```

### JavaScript

```js
const retval = RequestResourceFileSet(setName);

// by hash
const retval = Citizen.invokeNative('0xe7490533', setName, Citizen.returnResultAnyway());
```

### C#

```csharp
bool retval = Function.Call<bool>((Hash)0xe7490533, setName);
```

## Examples

*Source: Cfx.re native reference*

```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)
```

*Sources: Cfx.re native reference.*
