REGISTER_RESOURCE_ASSET
Registers a cached resource asset with the resource system, similar to the automatic scanning of the stream/ folder.
Signature
char* REGISTER_RESOURCE_ASSET(char* resourceName, char* fileName);Parameters
| Name | Type | Description |
|---|---|---|
resourceName | char* | The resource to add the asset to. |
fileName | char* | A file name in the resource. |
Returns char* — A cache string to pass to `REGISTER_STREAMING_FILE_FROM_CACHE` on the client.
Description
Experimental: This native may be altered or removed in future versions of CitizenFX without warning.
Registers a cached resource asset with the resource system, similar to the automatic scanning of the stream/ folder.
Usage
local retval = RegisterResourceAsset(resourceName, fileName)
-- always works, by hash
local retval = Citizen.InvokeNative(0x9862b266, resourceName, fileName, Citizen.ResultAsString())JavaScript and C#
const retval = RegisterResourceAsset(resourceName, fileName);
// by hash
const retval = Citizen.invokeNative('0x9862b266', resourceName, fileName, Citizen.returnResultAnyway(), Citizen.resultAsString());string retval = Function.Call<string>((Hash)0x9862b266, resourceName, fileName);Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.