Incomplete
This page is incomplete and only exist to give a minimum understanding of this subject. This will be expanded in the future.
Reason: Key names are clear enough and with the auto completion of TypeScript explaining all steps seem unnecessary.
Types
If you found some weird/custom types in our documentation you can find what they mean on this page. If you are missing any let use know on Discord.
CoreObject
This is similar to qb-core or ESX core object but our version isn't framework & script specific.
Note
The following table is a bit different then our other type defining tables.
We sometimes directly define types that are nested further in an object.
For example: If a function named Func is stored in a nested object named sub within the core you would call it as follows:
local CoreObject = exports["rn-bridge"]:GetCoreObject()
CoreObject.sub.Func() -- <== This is how it will be displayed in the table as well.
const CoreObject = exports["rn-bridge"].GetCoreObject()
CoreObject.sub.Func() // <-- This is how it will be displayed in the table as well.
import { type CoreObject } from "@rn/lib_server" // Or client depending on the script's network side
const CoreObject = exports["rn-bridge"].GetCoreObject() as CoreObject
CoreObject.sub.Func() // <-- This is how it will be displayed in the table as well.
Warning
Things like CreateCallback, TriggerClientCallback, TriggerServerCallback and TriggerCallback is our own network callback system.
This is NOT compatible with QB, ESX or OX callbacks.
| Key | Type | Description |
|---|---|---|
| GetFrameworkBridge | Function: Framework | null | Getting the Framework bridge to access framework specific actions. If this return null, the bridge hasn't been setup for this module. |
| GetInventoryBridge | Function: InventorySystem | null | Getting the Inventory bridge to access inventory specific actions. If this return null, the bridge hasn't been setup for this module. |
| GetInstancingBridge | Function: Instancing | Getting the Instancing bridge to manage routing buckets and instances. |
| GetNotifyBridge | Function: Notify | null | Getting the Notify bridge to access notification actions. If this return null, the bridge hasn't been setup for this module. |
| GetBankingBridge | Function: Banking | null | Getting the Banking bridge to access banking actions. If this return null, the bridge hasn't been setup for this module. |
| GetProgressbarBridge | Function: ProgressbarSystem | null | Getting the Progressbar bridge to access progressbar actions. If this return null, the bridge hasn't been setup for this module. |
| GetJobQueueSystem | Function: FiveMQExports | Getting the Job Queue system exports. |
| GetVehicleKeysBridge | Function: VehicleKeys | null | Getting the Vehicle Keys bridge to access vehicle key actions. If this return null, the bridge hasn't been setup for this module. |
| SoundLib | Object: SoundLib | Sound library helpers. |
| SoundLib.PlaySound | Function: string | Play a sound at a position or on self. |
| SoundLib.PlaySoundOnEntity | Function: string | Play a sound on an entity. |
| SoundLib.StopSound | Function: void | Stop a playing sound. |
| Functions | Object: CallbackFunctions & EventCallbackFunctions | Callback and event helper functions. |
| Functions.CreateCallback | Function: void | Register a server callback. |
| Functions.TriggerClientCallback | Function: Promise<V> | Trigger a client callback and await a result. |
| Functions.TriggerCallback | Function: V | Promise<V> | null | Trigger a server callback and return a result. |
| Functions.HandleServerEventCallback | Function: void | Handle a server event callback response. |
| Functions.CreateWarehouse | Function: Promise<boolean> | Create a warehouse entry. |
| ClientAsks | Object | Client-side request helpers. |
| ClientAsks.GetVehicleClassFromName | Function: Promise<VehicleClass> | Get a vehicle class from a model hash or name. |
| ClientAsks.GetVehicleClass | Function: Promise<VehicleClass | null> | Get a vehicle class from a networked vehicle id. |
| ClientAsks.GetVehicleData | Function: Promise<PlayerVehicleData | null> | Get vehicle data for a networked vehicle id. |
| ClientAsks.FadeInScreen | Function: void | Fade the client screen in. |
| ClientAsks.FadeOutScreen | Function: void | Fade the client screen out. |
| Key | Type | Description |
|---|---|---|
| GetFrameworkBridge | Function: Framework | null | Getting the Framework bridge to access framework specific actions. If this return null, the bridge hasn't been setup for this module. |
| GetTargetingBridge | Function: Targeting | null | Getting the Targeting bridge to access targeting actions. If this return null, the bridge hasn't been setup for this module. |
| GetMenuBridge | Function: Menu | null | Getting the Menu bridge to access menu actions. If this return null, the bridge hasn't been setup for this module. |
| GetNotifyBridge | Function: Notify | null | Getting the Notify bridge to access notification actions. If this return null, the bridge hasn't been setup for this module. |
| GetInventoryBridge | Function: InventorySystem | null | Getting the Inventory bridge to access inventory specific actions. If this return null, the bridge hasn't been setup for this module. |
| GetProgressbarBridge | Function: ProgressbarSystem | null | Getting the Progressbar bridge to access progressbar actions. If this return null, the bridge hasn't been setup for this module. |
| GetScheduler | Function: Scheduler | Getting the Scheduler to manage tasks, markers, and help text. |
| SoundLib | Object: SoundLib | Sound library helpers. |
| SoundLib.PlayLocalSound | Function: void | Play a local sound at a position or on self. |
| SoundLib.PlayLocalSoundOnEntity | Function: void | Play a local sound on an entity. |
| SoundLib.StopLocalSound | Function: void | Stop a playing local sound. |
| Functions | Object: CallbackFunctions & EventCallbackFunctions & InRangeHandling & EventWrapper | Callback, event, and helper functions. |
| Functions.CreateCallback | Function: void | Register a client callback. |
| Functions.TriggerServerCallback | Function: Promise<V> | Trigger a server callback and await a result. |
| Functions.TriggerCallback | Function: V | Promise<V> | null | Trigger a client callback and return a result. |
| Functions.HandleEventCallback | Function: Promise<R> | Handle an event callback response. |
| Functions.AddInRange | Function: void | Register enter/exit range handlers. |
| Functions.RemoveInRange | Function: void | Remove a range handler by id. |
| Functions.RemoveAllInRange | Function: void | Remove all range handlers. |
| Functions.requestEvent | Function: boolean | Request a wrapped event to be tracked. |
| Functions.onChange | Function: string | Register a change handler and return its id. |
| Functions.removeOnChange | Function: void | Remove a change handler by id. |
| Functions.CopyToClipboard | Function: void | Copy text to the clipboard. |
| Functions.KeypadSession | Function: Promise<void> | Open a keypad session and resolve when closed. |
| Functions.HideKeypad | Function: void | Hide the keypad UI. |
| Functions.ShowKeypad | Function: void | Show the keypad UI. |
| Functions.OpenConfigScreen | Function: void | Open a config screen for a resource. |
| Functions.FadeTeleport | Function: Promise<void> | Fade the screen and teleport to a position. |
| Functions.RPGConversation | Function: Promise<string> | Open an RPG conversation and return the selected option. |
| Functions.PressOnTimeMinigame | Function: Promise<ProgressionState> | Start the press-on-time minigame. |
EventCallback
The callback that gets triggered when your callback event gets called.
Return: any
Arguments
| Argument | Type | Description |
|---|---|---|
| src | Number | The server id that is calling your callback. |
| ... | Any[] | Arguments that have been passed to your callback. |
| Argument | Type | Description |
|---|---|---|
| ... | Any[] | Arguments that have been passed to your callback. |