START_NEW_SCRIPT_WITH_ARGS
Starts a new thread running scriptName and passes it argCount arguments from args. Returns the thread id.
Signature
int START_NEW_SCRIPT_WITH_ARGS(const char* scriptName, Any* args, int argCount, int stackSize); // 0xB8BA7F44DF1575E1 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | scriptName | const char* |
| 2 | args | Any* (out pointer) |
| 3 | argCount | int |
| 4 | stackSize | int |
Facts
| Name | START_NEW_SCRIPT_WITH_ARGS |
|---|---|
| Hash | 0xB8BA7F44DF1575E1 |
| Namespace | |
| Returns | int |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local result, args = Citizen.InvokeNative(0xB8BA7F44DF1575E1, -- START_NEW_SCRIPT_WITH_ARGS
"text", -- const char* scriptName
Citizen.PointerValueInt(), -- Any* args
0, -- int argCount
0, -- int stackSize
Citizen.ResultAsInteger()
)
print(result, args)const [result, args] = Citizen.invokeNative("0xB8BA7F44DF1575E1", // START_NEW_SCRIPT_WITH_ARGS
"text", // const char* scriptName
Citizen.pointerValueInt(), // Any* args
0, // int argCount
0, // int stackSize
Citizen.resultAsInteger()
);
console.log(result, args)var argsArg = new OutputArgument();
int result = Function.Call<int>((Hash)0xB8BA7F44DF1575E1, // START_NEW_SCRIPT_WITH_ARGS
"text", // const char* scriptName
argsArg, // Any* args
0, // int argCount
0 // int stackSize
);
int args = argsArg.GetResult<int>();Related SCRIPT natives
- START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS
- START_NEW_SCRIPT_WITH_NAME_HASH
- START_NEW_SCRIPT
- SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED
- DOES_SCRIPT_WITH_NAME_HASH_EXIST
- GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH
- HAS_SCRIPT_WITH_NAME_HASH_LOADED
- REQUEST_SCRIPT_WITH_NAME_HASH
- SCRIPT_THREAD_ITERATOR_GET_NEXT_THREAD_ID
- SCRIPT_THREAD_ITERATOR_RESET
- SET_SCRIPT_AS_NO_LONGER_NEEDED
- _IS_BACKGROUND_SCRIPT
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.