{"hash":"0xB8BA7F44DF1575E1","ns":"SCRIPT","name":"START_NEW_SCRIPT_WITH_ARGS","slug":"START_NEW_SCRIPT_WITH_ARGS","official":true,"named":true,"luaName":"StartNewScriptWithArgs","game":"rdr3","apiset":"client","returnType":"int","params":[{"name":"scriptName","type":"const char*"},{"name":"args","type":"Any*"},{"name":"argCount","type":"int"},{"name":"stackSize","type":"int"}],"summary":"Pass pointer to struct of args in p1, size of struct goes into p2","descriptions":[{"source":"alloc8or","format":"text","body":"return : script thread id, 0 if failed\nPass pointer to struct of args in p1, size of struct goes into p2"}],"examples":[],"aliases":[],"enums":[],"related":[],"build":"1207","gtaHash":"0xB8BA7F44DF1575E1","gtaJhash":"0x4A2100E4","sources":["alloc8or"],"doc":2,"url":"https://natives.borderlinerp.com/natives/SCRIPT/START_NEW_SCRIPT_WITH_ARGS","markdownUrl":"https://natives.borderlinerp.com/natives/SCRIPT/START_NEW_SCRIPT_WITH_ARGS.md","snippets":{"lua":"local retval, args = StartNewScriptWithArgs(scriptName, argCount, stackSize)","luaInvoke":"local retval, args = Citizen.InvokeNative(0xB8BA7F44DF1575E1, scriptName, Citizen.PointerValueInt(), argCount, stackSize, Citizen.ResultAsInteger())","js":"const [retval, args] = StartNewScriptWithArgs(scriptName, argCount, stackSize);","jsInvoke":"const [retval, args] = Citizen.invokeNative('0xB8BA7F44DF1575E1', scriptName, Citizen.pointerValueInt(), argCount, stackSize, Citizen.returnResultAnyway(), Citizen.resultAsInteger());","csharp":"var args = new OutputArgument();\nint retval = Function.Call<int>((Hash)0xB8BA7F44DF1575E1, scriptName, args, argCount, stackSize);\n// args.GetResult<int>()","notes":["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."]}}