Skip to main content

Available Client Exports

NPWD includes serveral available exports to easily interface with NPWD behavior and actions. You can find a list of the available client exports below.

sendUIMessage

Use this in third-party apps when sending NUI messages. Accepts any data.

exports.npwd:sendUIMessage({ type = "EVENT", payload = { dog = "woof", cat = "meow" }})

openApp

Will open the NPWD app of the given app id.

exports.npwd:openApp('CONTACTS')

setPhoneVisible

Accepts a boolean value to show or hide the phone. Will take into account the phone disabled state.

exports.npwd:setPhoneVisible(true)

setPhoneDisabled

Sets whether the phone is disabled or not. When the phone is disabled, the player will be unable to open the phone and will not receive notifications

exports.npwd:setPhoneDisabled(true)

isPhoneDisabled

The getter equivalent of setPhoneDisabled, returns whether the phone is in a disabled state or not.

local isDisabled = exports.npwd:isPhoneDisabled()

isPhoneVisible

The getter equivalent of setPhoneVisable, returns whether the phone is in a visible state or not.

local isPhoneVisible = exports.npwd:isPhoneVisible()

startPhoneCall

Will initiate a phone call to the given phone number.

exports.npwd:startPhoneCall('603-555-1212')

isInCall

Returns whether the player is in a phone call or not.

local isInCall = exports.npwd:isInCall()

endCall

Will end the current phone call the player is in.

local endCall = exports.npwd:endCall()

fillNewContact

Opens the contact app and fills in a new contact form with the given data, it will not create the contact until the player confirms the action.

exports.npwd:fillNewContact({ name = 'John Doe', number = '603-555-1212', avatar = 'https://i.imgur.com/j3UvwQA.png' })

fillNewNote

Will automatically open the notes app and start the new note processfilling in all of the fields with passed data. If this number already exists, it will edit it.

exports.npwd:fillNewNote({ title = 'Some Note', content = 'This is the filled in content of the note' })

getPhoneNumber

Returns the clients phone number

exports.npwd:getPhoneNumber()