RedM Natives

COPY_SCRIPT_STRUCT

Old name: _COPY_MEMORY

Hash0xF7AC7DC0DEE7C9BE
Runtime nameCopyScriptStruct
NamespaceMISC
SideClient
NameOfficial
Docs
Since build1207
GTA V hash0x213AEB2B90CBA7AC

Signature

void COPY_SCRIPT_STRUCT(Any* dst, Any* src, int size);

Parameters

NameTypeDescription
dstAny*—
srcAny*—
sizeint—

Returns void

Description

Old name: _COPY_MEMORY

Usage

Lua
local dst, src = CopyScriptStruct(size)

-- always works, by hash
local dst, src = Citizen.InvokeNative(0xF7AC7DC0DEE7C9BE, Citizen.PointerValueInt(), Citizen.PointerValueInt(), size)
JavaScript and C#
JavaScript
const [dst, src] = CopyScriptStruct(size);

// by hash
const [dst, src] = Citizen.invokeNative('0xF7AC7DC0DEE7C9BE', Citizen.pointerValueInt(), Citizen.pointerValueInt(), size);
C#
var dst = new OutputArgument();
var src = new OutputArgument();
Function.Call((Hash)0xF7AC7DC0DEE7C9BE, dst, src, size);
// dst.GetResult<int>()
// src.GetResult<int>()
  • Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
  • Any* arguments are often structs. Build them with a DataView buffer and pass it with :Buffer() — see the examples and notes below.

Sources

alloc8or RDR3 NativeDB

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.