Documentation Index
Fetch the complete documentation index at: https://docs.roadshop.org/llms.txt
Use this file to discover all available pages before exploring further.
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.Call Management
acceptCall
Accept the current incoming call. Useful for smartwatch or external call control.true if an incoming call was accepted, false if no incoming call exists.declineCall
Decline the current incoming call.true if an incoming call was declined, false if no incoming call exists.endCall
End the current active, incoming, or outgoing call.true if a call was ended, false if no call exists.getCallState
Get the current call state including direction, number, mute status, and contact name.{ state = "idle"|"active"|"incoming"|"outgoing", number = string|nil, isMuted = boolean, contactName = string|nil }Phone Data Access
getContacts
Get all contacts cached on the client.Array of contact objects.
getMessages
Get all messages cached on the client.Array of message objects.
getUnreadMessages
Get all unread received messages.Array of unread message objects (only received messages, not sent).
getRecentCalls
Get the recent call history.Array of recent call objects.
getFavouriteContacts
Get all contacts marked as favourites.Array of contact objects where
favourite == 1.getNotes
Get the player’s notes (requires RoadWatch).Array of note objects, or
nil if RoadWatch is disabled.getBankTransactions
Get the bank transaction history cached on the client.Array of bank transaction objects.
getBankIban
Get the player’s bank IBAN.The player’s bank IBAN string.
getWeather
Get the most recent weather data.The last weather data object, or
nil if not yet received.Music Control
These exports are designed for RoadWatch (smartwatch) integration but can be used by any external resource.
getMusicState
Get the current music playback state.{ isPlaying = bool, isPaused = bool, title = string|nil, artist = string|nil, image = string|nil, length = number, current = number, lengthFormatted = string, currentFormatted = string, volume = number, isRadio = bool }watchPauseMusic
Pause the currently playing music.true if pause command was sent, false if no music playing or already paused.watchResumeMusic
Resume paused music.true if resume command was sent, false if not playing or not paused.watchNextSong
Skip to the next song (disabled for radio).true if next command was sent, false if not playing or is radio.watchPreviousSong
Go to the previous song (disabled for radio).true if previous command was sent, false if not playing or is radio.watchSetVolume
Set the music playback volume.Volume level between 0 and 100.
true if volume was set, false if invalid volume.watchPlaySong
Play a specific song by its metadata.Song data object.
true if play command was sent, false if song data is invalid or missing id.Health Tracking
These exports return client-side simulated health data. The health system must be enabled in the config.
getClientHealthData
Get all current client-side health data.{ steps = number, distance = number, calories = number, activeMinutes = number, heartRate = number, stress = number, bloodPressure = { systolic = number, diastolic = number }, spo2 = number, isSleeping = boolean }getClientHeartRate
Get the player’s current simulated heart rate.Current heart rate in bpm (range: 50-200).
getClientStress
Get the player’s current simulated stress level.Current stress level (0-100).
getClientSteps
Get the player’s accumulated step count for this session.Total steps walked/run this session.