LOAD_RESOURCE_FILE
Reads the contents of a text file in a specified resource.
Signature
char* LOAD_RESOURCE_FILE(char* resourceName, char* fileName);Parameters
| Name | Type | Description |
|---|---|---|
resourceName | char* | The resource name. |
fileName | char* | The file in the resource. |
Returns char* — The file contents
Description
Reads the contents of a text file in a specified resource.
If executed on the client, this file has to be included in files in the resource manifest.
Example: local data = LoadResourceFile("devtools", "data.json")
Usage
local retval = LoadResourceFile(resourceName, fileName)
-- always works, by hash
local retval = Citizen.InvokeNative(0x76a9ee1f, resourceName, fileName, Citizen.ResultAsString())JavaScript and C#
const retval = LoadResourceFile(resourceName, fileName);
// by hash
const retval = Citizen.invokeNative('0x76a9ee1f', resourceName, fileName, Citizen.returnResultAnyway(), Citizen.resultAsString());string retval = Function.Call<string>((Hash)0x76a9ee1f, resourceName, fileName);See also
SAVE_RESOURCE_FILEWrites the specified data to a file in the specified resource.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.