High Scripts

Documentation

Client

Client export functions / types

General

openPhone

Opens the phone if the player has one and it's possible to do so.

Arguments

NameTypeDescription
forced?booleanBypass any checks, including has item check

Example

client.lua
-- Opens the phone forcefully even if the player is in water, or dead.
exports['high-phone']:openPhone(true)

closePhone

Closes the phone.

Example

client.lua
exports['high-phone']:closePhone()

sendNui

Sends an NUI message to the phone. Mostly useful when trying to manipulate the phone's behavior.

Example

client.lua
exports['high-phone']:sendNui({
    action = 'myevent',
    payload = {
        hello = 'world'
    }
})

sendAppNui

Sends an NUI message to a custom app.

Example

client.lua
exports['high-phone']:sendAppNui('test_app', {
    action = 'myevent',
    payload = {
        hello = 'world'
    }
})

sendNotification

Sends a notification to the phone. Can also be from an application.

Example

client.lua
exports['high-phone']:sendNotification({
    title = 'Hello World',
    content = 'Hello World',
    application = { name = 'twizzler' },
    icon = {
        name = 'fa-solid fa-envelope',
        imageUrl = '',
        color = '#fff',
        sizeMultiplier = 1.0
    },
    duration = 5000
})

getSettings

Gets the settings of a player's current phone

Arguments

NameTypeDescription
settingName?stringSetting you want to get (optional)

Example

client.lua
-- To get just one setting
local airplaneMode = exports['high-phone']:getSettings('airplaneMode')
-- OR to get all settings
local settings = exports['high-phone']:getSettings()

toggleCamera

Toggles the camera view for use in apps, etc.

Arguments

NameTypeDescriptionDefault
statebooleanWhether to enable or disable the camera view-
facing?'front' | 'rear'Facing of the camera'rear'
portrait?booleanEnable or disable portrait mode (blurry background)false

Example

client.lua
-- Enables the front camera with portrait mode enabled.
exports['high-phone']:toggleCamera(true, 'front', true)

setCameraFacing

Change camera facing to either rear or front while camera view is enabled.

Arguments

NameTypeDescription
facing'front' | 'rear'Facing of the camera

Example

client.lua
-- Enables the front camera if camera view is enabled.
exports['high-phone']:setCameraFacing('front')

getSignal

Gets the provider name and the signal strength of the current area player is in. If using a custom signal getter function in the config, it will be used to return the strength and provider.

Returned type

NameTypeDescription
providerstringProvider name
strengthnumberSignal strength in a 0.0 to 1.0 range

Example

client.lua
local signalData = exports['high-phone']:getSignal()
local provider = signalData.provider
local strength = signalData.strength

toggleUsability

Formats a phone number string into what you have configured.

Arguments

NameTypeDescription
statebooleanSetting this to false will prevent the player from opening the phone
keepOpen?booleanIf the phone is currently open, optionally don't close it

Example

client.lua
local formattedNumber = exports['high-phone']:toggleUsability(true)

isDisabled

Returns whether the phone is currently disabled (including toggleUsability)

Example

client.lua
local isDisabled = exports['high-phone']:isDisabled()

Maps

setBlipName

Sets a name for a blip in maps application, since we cannot access blip names by use of natives.

Arguments

NameTypeDescription
blipnumberBlip handle
namestringBlip name

Example

client.lua
local blip = AddBlipForCoord(0.0, 0.0, 0.0)
SetBlipSprite(blip, 1)
 
local blipName = 'Test Blip'
BeginTextCommandSetBlipName("STRING")
AddTextComponentString(blipName)
EndTextCommandSetBlipName(blip)
 
exports['high-phone']:setBlipName(blip, blipName)

Valet

canUseValet

Returns whether is valet currenty disabled or not.

Example

client.lua
local canUseValet = exports['high-phone']:canUseValet()

toggleValet

Toggles the usability of Valet services.

Arguments

NameTypeDescription
statebooleanSetting this to true will prevent the player from using valet services

Example

client.lua
-- Disables valet services for the player.
exports['high-phone']:toggleValet(false)

Last updated on

On this page