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
closePhone
Closes the phone.
Example
sendNui
Sends an NUI message to the phone. Mostly useful when trying to manipulate the phone's behavior.
Example
sendAppNui
Sends an NUI message to a custom app.
Example
sendNotification
Sends a notification to the phone. Can also be from an application.
Example
getSettings
Gets the settings of a player's current phone
Arguments
Name | Type | Description |
---|---|---|
settingName? | string | Setting you want to get (optional) |
Example
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
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
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
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
isDisabled
Returns whether the phone is currently disabled (including toggleUsability)
Example
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
Valet
canUseValet
Returns whether is valet currenty disabled or not.
Example
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
Last updated on