REQUEST_RESOURCE_FILE_SET
Requests a resource file set with the specified name to be downloaded and mounted on top of the current resource.
Signature
BOOL REQUEST_RESOURCE_FILE_SET(char* setName);Parameters
| Name | Type | Description |
|---|---|---|
setName | char* | The name of the file set as specified in |
Returns BOOL — `TRUE` if the set is mounted, `FALSE` if the request is still pending.
Description
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:
file_set 'addon_ui' {
'ui/addon/index.html',
'ui/addon/**.js',
}This command will trigger a script error if the request failed.
Usage
local retval = RequestResourceFileSet(setName)
-- always works, by hash
local retval = Citizen.InvokeNative(0xe7490533, setName, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = RequestResourceFileSet(setName);
// by hash
const retval = Citizen.invokeNative('0xe7490533', setName, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0xe7490533, setName);Examples
-- 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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.