START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS
Hash
0xC4BB298BD441BE78Runtime name
StartNewScriptWithNameHashAndArgsNamespaceSCRIPT
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xC4BB298BD441BE78Signature
int START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS(Hash scriptHash, Any* args, int argCount, int stackSize);Parameters
| Name | Type | Description |
|---|---|---|
scriptHash | Hash | — |
args | Any* | — |
argCount | int | — |
stackSize | int | — |
Returns int
Usage
local retval, args = StartNewScriptWithNameHashAndArgs(scriptHash, argCount, stackSize)
-- always works, by hash
local retval, args = Citizen.InvokeNative(0xC4BB298BD441BE78, scriptHash, Citizen.PointerValueInt(), argCount, stackSize, Citizen.ResultAsInteger())JavaScript and C#
const [retval, args] = StartNewScriptWithNameHashAndArgs(scriptHash, argCount, stackSize);
// by hash
const [retval, args] = Citizen.invokeNative('0xC4BB298BD441BE78', scriptHash, Citizen.pointerValueInt(), argCount, stackSize, Citizen.returnResultAnyway(), Citizen.resultAsInteger());var args = new OutputArgument();
int retval = Function.Call<int>((Hash)0xC4BB298BD441BE78, scriptHash, args, argCount, stackSize);
// args.GetResult<int>()- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("name")or a backtick literal like`name`. - 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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.