SAVE_RESOURCE_FILE
Writes the specified data to a file in the specified resource.
Signature
BOOL SAVE_RESOURCE_FILE(char* resourceName, char* fileName, char* data, int dataLength);Parameters
| Name | Type | Description |
|---|---|---|
resourceName | char* | The name of the resource. |
fileName | char* | The name of the file. |
data | char* | The data to write to the file. |
dataLength | int | The length of the written data. |
Returns BOOL — A value indicating if the write succeeded.
Description
Writes the specified data to a file in the specified resource.
Using a length of -1 will automatically detect the length assuming the data is a C string.
Usage
local retval = SaveResourceFile(resourceName, fileName, data, dataLength)
-- always works, by hash
local retval = Citizen.InvokeNative(0xa09e7e7b, resourceName, fileName, data, dataLength, Citizen.ReturnResultAnyway())JavaScript and C#
const retval = SaveResourceFile(resourceName, fileName, data, dataLength);
// by hash
const retval = Citizen.invokeNative('0xa09e7e7b', resourceName, fileName, data, dataLength, Citizen.returnResultAnyway());bool retval = Function.Call<bool>((Hash)0xa09e7e7b, resourceName, fileName, data, dataLength);See also
LOAD_RESOURCE_FILEReads the contents of a text file in a specified resource.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.