START_NEW_SCRIPT_WITH_ARGS
Pass pointer to struct of args in p1, size of struct goes into p2
Hash
0xB8BA7F44DF1575E1Runtime name
StartNewScriptWithArgsNamespaceSCRIPT
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0xB8BA7F44DF1575E1Signature
int START_NEW_SCRIPT_WITH_ARGS(const char* scriptName, Any* args, int argCount, int stackSize);Parameters
| Name | Type | Description |
|---|---|---|
scriptName | const char* | — |
args | Any* | — |
argCount | int | — |
stackSize | int | — |
Returns int
Description
return : script thread id, 0 if failed
Pass pointer to struct of args in p1, size of struct goes into p2
Usage
local retval, args = StartNewScriptWithArgs(scriptName, argCount, stackSize)
-- always works, by hash
local retval, args = Citizen.InvokeNative(0xB8BA7F44DF1575E1, scriptName, Citizen.PointerValueInt(), argCount, stackSize, Citizen.ResultAsInteger())JavaScript and C#
const [retval, args] = StartNewScriptWithArgs(scriptName, argCount, stackSize);
// by hash
const [retval, args] = Citizen.invokeNative('0xB8BA7F44DF1575E1', scriptName, Citizen.pointerValueInt(), argCount, stackSize, Citizen.returnResultAnyway(), Citizen.resultAsInteger());var args = new OutputArgument();
int retval = Function.Call<int>((Hash)0xB8BA7F44DF1575E1, scriptName, args, argCount, stackSize);
// args.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
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.