class Script
package fivem.client.natives
Static methods
staticGetNameOfThread(threadId:Int):String
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;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.
staticTriggerScriptEvent2(eventGroup:Int, eventData:Dynamic, eventDataSize:Int, playerBits:Int):Dynamic
See TRIGGER_SCRIPT_EVENTstaticbgEndContext(contextName:String):Dynamic
Deletes the given context from the background scripts context map.
NativeDB Introduced: v323staticbgEndContextHash(contextHash:Int):Dynamic
Hashed version of 0xDC2BACD920D0A0DD.
NativeDB Introduced: v323staticbgStartContext(contextName:String):Dynamic
Inserts the given context into the background scripts context map.
NativeDB Introduced: v323staticbgStartContextHash(contextHash:Int):Dynamic
Hashed version of 0x9D5A25BADB742ACD.
NativeDB Introduced: v323staticdoesScriptExist(scriptName:String):Bool
staticdoesScriptWithNameHashExist(scriptHash:Int):Bool
staticgetEventAtIndex(eventGroup:Int, eventIndex:Int):Int
eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork)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!).staticgetEventExists(eventGroup:Int, eventIndex:Int):Bool
eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork)staticgetHashOfThisScriptName():Int
staticgetIdOfThisThread():Int
staticgetNoLoadingScreen():Bool
staticgetNumberOfEvents(eventGroup:Int):Int
eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork)staticgetThisScriptName():String
statichasScriptLoaded(scriptName:String):Bool
Returns if a script has been loaded into the game. Used to see if a script was loaded after requesting.
statichasScriptWithNameHashLoaded(scriptHash:Int):Bool
staticisThreadActive(threadId:Int):Bool
staticrequestScript(scriptName:String):Dynamic
staticscriptThreadIteratorGetNextThreadId():Int
If the function returns 0, the end of the iteration has been reached.staticscriptThreadIteratorReset():Dynamic
Starts a new iteration of the current threads. Call this first, then SCRIPT_THREAD_ITERATOR_GET_NEXT_THREAD_ID (0x30B4FA1C82DD4B9F)
staticsetNoLoadingScreen(toggle:Bool):Dynamic
staticsetScriptAsNoLongerNeeded(scriptName:String):Dynamic
staticsetScriptWithNameHashAsNoLongerNeeded(scriptHash:Int):Dynamic
staticshutdownLoadingScreen():Dynamic
staticterminateThisThread():Dynamic
staticterminateThread(threadId:Int):Dynamic
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.