Skip to content

NUI Client

NUI is a module to handle NUI interfaces

JO Functions

jo.nui.forceFocus()

Forces focus on a specific NUI interface and don't spread events to other NUIs

Syntax

lua
jo.nui.forceFocus(uiName)

Parameters

uiName : string

The name of the NUI to focus on

Example

lua
jo.nui.forceFocus('my_crew_hud')

jo.nui.isLoaded()

A function to know if a nui is loaded

Syntax

lua
jo.nui.isLoaded(uiName)

Parameters

uiName : string

The name of the NUI

Return Value

Type : boolean

true if the nui is already loaded

Example

lua
local isLoaded = jo.menu.isLoaded('my_crew_hud')
-- Expected output: `true` is the nui is loaded, else `false`

jo.nui.load()

Loads a NUI interface

Syntax

lua
jo.nui.load(uiName, url)

Parameters

uiName : string

The name of the NUI to load

url : string

The URL of the NUI to load

Example

lua
local uiName = "my_crew_hud"
local url = "nui://myResource/folder/index.html"
jo.nui.load(uiName, url)

jo.nui.resetFocus()

Resets the focus from any NUI interface and spread events

Syntax

lua
jo.nui.resetFocus()

Example

lua
jo.nuit.forceFocus('my_crew_hud')
Wait(10000)
jo.nui.resetFocus()

Last updated: