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.
Server Exports
RoadPhone Pro provides several server-side exports that allow other resources to interact with the phone system.Player Information
getPlayerFromPhone
Get a player’s server ID from their phone number.The phone number to look up.
The player’s server ID (source), or
nil if not found or offline.getNumberFromIdentifier
Get a player’s phone number from their identifier.The player’s identifier (license, citizenid, etc.).
The player’s phone number, or
nil if not found.Banking & IBAN
getPlayerIBAN
Get or create an IBAN for a player.The player’s server ID.
The player’s IBAN. If the player doesn’t have one, a new unique IBAN will be generated.
IBAN format is configurable via
Cfg.BankIBANPrefix (default: “DE”) + 6 random digits.getPlayerFromIBAN
Find a player by their IBAN.The IBAN to search for.
The player object (via Bridge.Player.GetPlayerByIdentifier), or
nil if not found.addBankTransaction
Add a bank transaction record to the transaction history.The sender’s IBAN.
The receiver’s IBAN.
The transaction reason/description.
The transaction amount.
This only adds a transaction record - it does not transfer actual money. Handle money transfers with your framework’s banking system.
Cryptocurrency
addcrypto
Add cryptocurrency to a player’s wallet.The player’s identifier.
The cryptocurrency ID (1 = Bitcoin, 2 = Ethereum, etc.).
The amount to add.
removecrypto
Remove cryptocurrency from a player’s wallet.The player’s identifier.
The cryptocurrency ID.
The amount to remove.
checkcryptoamount
Check if a player has at least a certain amount of cryptocurrency.The player’s identifier.
The cryptocurrency ID.
The amount to check for.
true if the player has at least the specified amount, false otherwise.getcryptoamount
Get the current cryptocurrency balance for a player.The player’s identifier.
The cryptocurrency ID.
The player’s balance for the specified cryptocurrency.
Communication
sendMailOffline
Send an email to a player by their identifier (works even if offline).The player’s identifier.
The email data object.
Dispatches
sendDispatch
Send a dispatch notification to all members of a specific job.The source player ID sending the dispatch.
The dispatch message content.
The target job name (e.g., “police”, “ambulance”).
Optional coordinates for the dispatch location.
Optional image URL for the dispatch.
sendDispatchAnonym
Send an anonymous dispatch notification (no sender information).The target job name.
The dispatch title/sender name shown in the notification.
The dispatch message content.
The dispatch location coordinates.
Optional image URL for the dispatch.
Use this for automated systems (store alarms, speed cameras, etc.) where there’s no actual player caller.
RoadDrop (AirDrop)
sendRoadDrop
Send a RoadDrop notification to nearby players.The RoadDrop data object.
Deprecated Alias:
sendAirdrop - Use sendRoadDrop for new implementations.Advanced Usage Examples
Complete Dispatch System Integration
Banking Integration
Crypto Payment System
Messages
sendMessage
Send an SMS message from one phone number to another. Works for both online and offline players.The sender’s phone number.
The recipient’s phone number.
The message content (must not be empty).
true on success, false if validation fails (missing params, empty message, same sender/receiver).Social Media
deleteConnectAccount
Delete a Connect (Instagram) account and all associated data (posts, likes, comments, stories).The Connect username to delete.
true if account found and deleted, false if username not found.deleteTweetWaveAccount
Delete a TweetWave account and all associated data (tweets, likes, comments).The TweetWave username to delete.
true if account found and deleted, false if username not found.Taxi
saveTaxiTripToHistory
Save a taxi trip record to the database history.The customer’s phone number.
The driver’s phone number (optional).
The driver’s name (optional).
The pickup street name (optional).
The destination street name (optional).
The trip price (default:
0).The vehicle type (default:
'economy').Health Tracking
The health system requires
Config.BatterySystem or the health addon to be enabled. Server-side exports return data from the in-memory cache, which is updated by client sync events.getPlayerHealth
Get all current health data for a player from the server cache.The player’s server ID.
Health data table, or
nil if not cached.getPlayerHeartRate
Get a player’s current heart rate.The player’s server ID.
Heart rate in bpm (default:
70 if not cached).getPlayerStress
Get a player’s current stress level.The player’s server ID.
Stress level 0-100 (default:
0 if not cached).getPlayerSteps
Get a player’s step count for the current session.The player’s server ID.
Steps today (default:
0 if not cached).getPlayerDailyHealth
Get a player’s daily health summary from the database.The player’s server ID.
Date in
'YYYY-MM-DD' format (default: today).Database row with daily stats (steps, distance, calories, etc.), or
nil if no data.getPlayerHealthHistory
Get a player’s health history for the last N days.The player’s server ID.
Number of days to retrieve (default:
7).Array of daily health records ordered by date DESC.
isPlayerSleeping
Check if a player is currently sleeping.The player’s server ID.
true if sleeping, false otherwise.addSleepHours
Add sleep hours to a player’s daily health record. Useful for bed script integrations.The player’s server ID.
Number of sleep hours to add.
true on success, false if player identifier not found.setPlayerStress
Set a custom stress level for a player. Updates the server cache and notifies the client.The player’s server ID.
Stress level (automatically clamped to 0-100).
true on success, false if player identifier not found.getPlayerSpO2
Get a player’s blood oxygen saturation level.The player’s server ID.
SpO2 percentage (default:
98 if not cached).getPlayerBloodPressure
Get a player’s blood pressure values.The player’s server ID.
{ systolic = number, diastolic = number } (default: { systolic = 120, diastolic = 80 }).DarkChat
getDarkchatRooms
Get all DarkChat rooms/groups. Results are cached for 60 seconds.Array of
{ id = number, name = string, members = table }.getDarkchatGroupmessages
Get all DarkChat group messages. Results are cached for 60 seconds.Array of
{ id, groupname, sender, message, members, date }.getGroupMessages
Get messages for a specific DarkChat group.The DarkChat group name.
Maximum messages to return (default: config
MessageLimit or 80).Array of message objects in chronological order.
Music
getMusicLibrary
Search the music library by title or artist.Search term (optional — returns all if nil).
Maximum results (default:
50).Array of
{ id, url_type, title, artist, thumbnail, length }.Requires RoadWatch to be enabled. Returns empty table if disabled.
getPlayerPlaylists
Get a player’s playlists and saved songs.The player’s server ID.
{ playlists = table, songs = table }.Battery
Battery exports require
Config.BatterySystem = true and Config.UseMetadata = true.getBatteryLevel
Get a player’s current phone battery level.The player’s server ID.
Battery level (0-100).
setBatteryLevel
Set a player’s battery level. Updates metadata and notifies the client.The player’s server ID.
The new battery level (clamped to 0-100).
The new battery level after clamping.
chargeBattery
Charge a player’s battery by a specified amount.The player’s server ID.
Amount to charge (e.g.,
10 for 10%).The new battery level (capped at 100).
isBatteryDead
Check if a player’s phone battery is dead.The player’s server ID.
true if battery is at 0, false otherwise.startCharging
Start realistic (gradual) charging for a player’s phone.The player’s server ID.
true if charging started, false if already charging or battery is full.stopCharging
Stop charging a player’s phone.The player’s server ID.
isCharging
Check if a player’s phone is currently being charged.The player’s server ID.
true if currently charging, false otherwise.