Client
Client export functions / types
General
openPhone
Opens the phone if the player has one and it's possible to do so.
Arguments
Name | Type | Description |
---|---|---|
forced? | boolean | Bypass any checks, including has item check |
Example
-- Opens the phone forcefully even if the player is in water, or dead.
exports['high-phone']:openPhone(true)
closePhone
Closes the phone.
Example
exports['high-phone']:closePhone()
startCall
Start a phone call with a given phone number.
Arguments
Name | Type | Description |
---|---|---|
number | string | Phone number to dial |
video? | boolean | Video call |
Example
-- Call a phone number '123456789' with video turned on.
exports['high-phone']:startCall('123456789', true)
sendNui
Sends an NUI message to the phone. Mostly useful when trying to manipulate the phone's behavior.
Example
exports['high-phone']:sendNui({
action = 'myevent',
payload = {
hello = 'world'
}
})
sendAppNui
Sends an NUI message to a custom app.
Example
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
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
Name | Type | Description |
---|---|---|
settingName? | string | Setting you want to get (optional) |
Example
-- 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
Name | Type | Description | Default |
---|---|---|---|
state | boolean | Whether to enable or disable the camera view | - |
facing? | 'front' | 'rear' | Facing of the camera | 'rear' |
portrait? | boolean | Enable or disable portrait mode (blurry background) | false |
Example
-- 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
Name | Type | Description |
---|---|---|
facing | 'front' | 'rear' | Facing of the camera |
Example
-- 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
Name | Type | Description |
---|---|---|
provider | string | Provider name |
strength | number | Signal strength in a 0.0 to 1.0 range |
Example
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
Name | Type | Description |
---|---|---|
state | boolean | Setting this to false will prevent the player from opening the phone |
keepOpen? | boolean | If the phone is currently open, optionally don't close it |
Example
local formattedNumber = exports['high-phone']:toggleUsability(true)
isDisabled
Returns whether the phone is currently disabled (including toggleUsability)
Example
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
Name | Type | Description |
---|---|---|
blip | number | Blip handle |
name | string | Blip name |
Example
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
local canUseValet = exports['high-phone']:canUseValet()
toggleValet
Toggles the usability of Valet services.
Arguments
Name | Type | Description |
---|---|---|
state | boolean | Setting this to true will prevent the player from using valet services |
Example
-- Disables valet services for the player.
exports['high-phone']:toggleValet(false)
Battery
toggleCharging
Toggle charging of the phone.
Arguments
Name | Type | Description |
---|---|---|
toggle? | boolean | New state |
Example
exports['high-phone']:toggleCharging(true)
-- Or just
exports['high-phone']:toggleCharging()
isCharging
Check if the phone is currently charging.
Example
local isCharging = exports['high-phone']:isCharging()
setBattery
Set a battery percentage, 0.0 - 1.0.
Arguments
Name | Type | Description |
---|---|---|
percentage | number | New percentage to set |
Example
exports['high-phone']:setBattery(0.5)
Last updated on