Client Exports
RoadPhone Pro provides several client-side exports that allow other resources to interact with the phone system.Phone State
isPhoneOpen
Check if the phone UI is currently open.true if the phone is currently open, false otherwise.isBlocked
Check if the phone is currently blocked (e.g., during certain activities).true if the phone is blocked, false otherwise.blockPhone
Block the phone from being used. Useful for situations where phone usage should be disabled.Always returns
true.unblockPhone
Unblock the phone to allow normal usage again.Always returns
false.togglePhone
Open or close the phone programmatically.This toggles the phone state - if open it will close, if closed it will open.
Phone Information
getPhoneNumber
Get the phone number of the current player.The player’s phone number, or
nil if not available.isFlightmode
Check if flight mode is enabled on the phone.true if flight mode is enabled, false otherwise.isFlashlight
Check if the phone flashlight is currently active.true if the flashlight is on, false otherwise.isPlayerMuted
Check if the player is currently muted (e.g., in a call).true if the player is muted, false otherwise.Communication
sendMessage
Send an SMS message to a phone number.The recipient’s phone number.
The message content to send.
startCall
Initiate a phone call to a specific number.The phone number to call.
Whether to make an anonymous call (optional).
This export will automatically open the phone if it’s not already open.
sendMail
Send an email to the current player.The email data object.
sendMailOffline
Send an email to a player by their identifier (works even if offline).The player’s identifier (e.g., license or citizenid).
The email data object (same structure as
sendMail).Notifications & Dispatches
sendNotification
Send a notification to the player’s phone.The notification data object.
sendDispatch
Send a dispatch notification to job members.The dispatch message content.
The job name to send the dispatch to (e.g., “police”, “ambulance”).
Optional image URL for the dispatch.
UI Control
setHeaderBlack
Set the phone header (status bar) to black or white mode.true for black header, false for white header.Useful for apps with light backgrounds that need a dark header for visibility.
inputFocus
Control whether keyboard input is captured by NUI or passed to the game.true to capture input in NUI, false to allow game input.SendMessageNUI
Send a raw message directly to the phone NUI.The data object to send to NUI. Must include an
event key.