START_NEW_SCRIPT
Starts a new thread running the loaded script scriptName with the given stackSize, and returns its thread id.
Signature
int START_NEW_SCRIPT(const char* scriptName, int stackSize); // 0xE81651AD79516E48 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | scriptName | const char* |
| 2 | stackSize | int |
Facts
| Name | START_NEW_SCRIPT |
|---|---|
| Hash | 0xE81651AD79516E48 |
| 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 = Citizen.InvokeNative(0xE81651AD79516E48, -- START_NEW_SCRIPT
"text", -- const char* scriptName
0, -- int stackSize
Citizen.ResultAsInteger()
)
print(result)const result = Citizen.invokeNative("0xE81651AD79516E48", // START_NEW_SCRIPT
"text", // const char* scriptName
0, // int stackSize
Citizen.resultAsInteger()
);
console.log(result)int result = Function.Call<int>((Hash)0xE81651AD79516E48, // START_NEW_SCRIPT
"text", // const char* scriptName
0 // int stackSize
);Related SCRIPT natives
- START_NEW_SCRIPT_WITH_ARGS
- START_NEW_SCRIPT_WITH_NAME_HASH
- START_NEW_SCRIPT_WITH_NAME_HASH_AND_ARGS
- SCRIPT_THREAD_ITERATOR_GET_NEXT_THREAD_ID
- SCRIPT_THREAD_ITERATOR_RESET
- SET_SCRIPT_AS_NO_LONGER_NEEDED
- SET_SCRIPT_WITH_NAME_HASH_AS_NO_LONGER_NEEDED
- _IS_BACKGROUND_SCRIPT
- _TRIGGER_SCRIPT_EVENT_2
- BG_GET_SCRIPT_ID_FROM_NAME_HASH
- BG_START_CONTEXT
- BG_START_CONTEXT_HASH
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.