Static methods

@:native("GetNameOfThread")staticGetNameOfThread(threadId:Int):String

@:native("GetNumberOfReferencesOfScriptWithNameHash")staticGetNumberOfReferencesOfScriptWithNameHash(scriptHash:Int):Int

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;

@:native("LockLoadingScreenButtons")staticLockLoadingScreenButtons():Dynamic

Updates the display of the MP/SP loading buttons, and locks the state so that other options are not displayed or changed. This can only be done once.

@:native("TriggerScriptEvent_2")staticTriggerScriptEvent2(eventGroup:Int, eventData:Dynamic, eventDataSize:Int, playerBits:Int):Dynamic

See TRIGGER_SCRIPT_EVENT

@:native("BgEndContext")staticbgEndContext(contextName:String):Dynamic

Deletes the given context from the background scripts context map.

NativeDB Introduced: v323

@:native("BgEndContextHash")staticbgEndContextHash(contextHash:Int):Dynamic

Hashed version of 0xDC2BACD920D0A0DD.

NativeDB Introduced: v323

@:native("BgStartContext")staticbgStartContext(contextName:String):Dynamic

Inserts the given context into the background scripts context map.

NativeDB Introduced: v323

@:native("BgStartContextHash")staticbgStartContextHash(contextHash:Int):Dynamic

Hashed version of 0x9D5A25BADB742ACD.

NativeDB Introduced: v323

@:native("DoesScriptExist")staticdoesScriptExist(scriptName:String):Bool

@:native("DoesScriptWithNameHashExist")staticdoesScriptWithNameHashExist(scriptHash:Int):Bool

@:native("GetEventAtIndex")staticgetEventAtIndex(eventGroup:Int, eventIndex:Int):Int

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork)

@:native("GetEventData")staticgetEventData(eventGroup:Int, eventIndex:Int, eventData:Dynamic, eventDataSize:Int):Bool

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork)
Note: eventDataSize is NOT the size in bytes, it is the size determined by the SIZE_OF operator (RAGE Script operator, not C/C++ sizeof). That is, the size in bytes divided by 8 (script variables are always 8-byte aligned!).

@:native("GetEventExists")staticgetEventExists(eventGroup:Int, eventIndex:Int):Bool

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork)

@:native("GetHashOfThisScriptName")staticgetHashOfThisScriptName():Int

@:native("GetIdOfThisThread")staticgetIdOfThisThread():Int

@:native("GetNoLoadingScreen")staticgetNoLoadingScreen():Bool

@:native("GetNumberOfEvents")staticgetNumberOfEvents(eventGroup:Int):Int

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork)

@:native("GetThisScriptName")staticgetThisScriptName():String

@:native("HasScriptLoaded")statichasScriptLoaded(scriptName:String):Bool

Returns if a script has been loaded into the game. Used to see if a script was loaded after requesting.

@:native("HasScriptWithNameHashLoaded")statichasScriptWithNameHashLoaded(scriptHash:Int):Bool

@:native("IsThreadActive")staticisThreadActive(threadId:Int):Bool

@:native("RequestScript")staticrequestScript(scriptName:String):Dynamic

@:native("RequestScriptWithNameHash")staticrequestScriptWithNameHash(scriptHash:Int):Dynamic

formerly _REQUEST_STREAMED_SCRIPT  

@:native("ScriptThreadIteratorGetNextThreadId")staticscriptThreadIteratorGetNextThreadId():Int

If the function returns 0, the end of the iteration has been reached.

@:native("ScriptThreadIteratorReset")staticscriptThreadIteratorReset():Dynamic

Starts a new iteration of the current threads. Call this first, then SCRIPT_THREAD_ITERATOR_GET_NEXT_THREAD_ID (0x30B4FA1C82DD4B9F)

@:native("SetNoLoadingScreen")staticsetNoLoadingScreen(toggle:Bool):Dynamic

@:native("SetScriptAsNoLongerNeeded")staticsetScriptAsNoLongerNeeded(scriptName:String):Dynamic

@:native("SetScriptWithNameHashAsNoLongerNeeded")staticsetScriptWithNameHashAsNoLongerNeeded(scriptHash:Int):Dynamic

@:native("ShutdownLoadingScreen")staticshutdownLoadingScreen():Dynamic

@:native("TerminateThisThread")staticterminateThisThread():Dynamic

@:native("TerminateThread")staticterminateThread(threadId:Int):Dynamic

@:native("TriggerScriptEvent")statictriggerScriptEvent(eventGroup:Int, eventData:Dynamic, eventDataSize:Int, playerBits:Int):Dynamic

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork)
Note: eventDataSize is NOT the size in bytes, it is the size determined by the SIZE_OF operator (RAGE Script operator, not C/C++ sizeof). That is, the size in bytes divided by 8 (script variables are always 8-byte aligned!).
playerBits (also known as playersToBroadcastTo) is a bitset that indicates which players this event should be sent to. In order to send the event to specific players only, use (1 << playerIndex). Set all bits if it should be broadcast to all players.