RedM Natives

_START_SCRIPT_BRAIN

Returns threadId

Hash0x6F62FAE266DCFC81
Runtime nameStartScriptBrain
NamespaceBRAIN
SideClient
NameCommunity guess
Docs
Since build1207

Signature

int _START_SCRIPT_BRAIN(Entity entity, const char* scriptName, int p2, Any* p3, int p4, BOOL p5);

Parameters

NameTypeDescription
entityEntity—
scriptNameconst char*—
p2int—
p3Any*—
p4int—
p5BOOL—

Returns int

Description

Returns threadId

Usage

Lua
local retval, p3 = StartScriptBrain(entity, scriptName, p2, p4, p5)

-- always works, by hash
local retval, p3 = Citizen.InvokeNative(0x6F62FAE266DCFC81, entity, scriptName, p2, Citizen.PointerValueInt(), p4, p5, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const [retval, p3] = StartScriptBrain(entity, scriptName, p2, p4, p5);

// by hash
const [retval, p3] = Citizen.invokeNative('0x6F62FAE266DCFC81', entity, scriptName, p2, Citizen.pointerValueInt(), p4, p5, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
var p3 = new OutputArgument();
int retval = Function.Call<int>((Hash)0x6F62FAE266DCFC81, entity, scriptName, p2, p3, p4, p5);
// p3.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.
  • The name is a community guess and may change. If the named call is missing in your client build, use InvokeNative with the hash — it always works.

Sources

alloc8or RDR3 NativeDB

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