GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH
Gets the number of instances of the specified script is currently running.
Hash
0x8E34C953364A76DDRuntime name
GetNumberOfThreadsRunningTheScriptWithThisHashNamespaceSCRIPT
SideClient
NameOfficial
Docs
Since build1207
GTA V hash
0x2C83A9DA6BFFC4F9Signature
int GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(Hash scriptHash);Parameters
| Name | Type | Description |
|---|---|---|
scriptHash | Hash | — |
Returns int
Description
Gets the number of instances of the specified script is currently running.
Actually returns numRefs - 1.
if (program)
v3 = rage::scrProgram::GetNumRefs(program) - 1;
return v3;
Old name: _GET_NUMBER_OF_REFERENCES_OF_SCRIPT_WITH_NAME_HASH
Usage
local retval = GetNumberOfThreadsRunningTheScriptWithThisHash(scriptHash)
-- always works, by hash
local retval = Citizen.InvokeNative(0x8E34C953364A76DD, scriptHash, Citizen.ResultAsInteger())JavaScript and C#
const retval = GetNumberOfThreadsRunningTheScriptWithThisHash(scriptHash);
// by hash
const retval = Citizen.invokeNative('0x8E34C953364A76DD', scriptHash, Citizen.returnResultAnyway(), Citizen.resultAsInteger());int retval = Function.Call<int>((Hash)0x8E34C953364A76DD, scriptHash);- 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`.
Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.