5M Phone
Use code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchaseUse code 'LAUNCH10' — 10% OFF on your first purchase
5M Phone5M Phone
  • Home
  • Docs
Login

Documentation

  • 5M Phone
  • Open & Un-escrowed Files
  • Installation
  • Configuration (Open Files)
  • 5M Watch Companion
  • Bridge Architecture (Open Files)
  • Exports & Events (Developer API)
    • Client Exports
    • Server Exports
    • State Bags & Events
    • Developer Apps API
    • Third-Party Compatibility (qb-mail & qb-phone)
  • Troubleshooting & FAQ
  • Custom App Development Guide
  • 5M Migration Tool
DocumentationExports & Events (Developer API)Server Exports
📄

Server Exports

Comprehensive server exports available on exports['5M_Phone'].


Core & Identity Exports

Lua
---@param srcOrCid number|string
---@return string|nil
local number = exports['5M_Phone']:GetPhoneNumber(source)
local number2 = exports['5M_Phone']:GetPhoneNumber(citizenid)

---@param phoneNumber string
---@return number|false onlineSource
local playerSource = exports['5M_Phone']:GetSourceFromNumber('5551234567')

---@param source number
---@return boolean ok, string? phoneId
exports['5M_Phone']:givePhone(source)

Push Notifications

Lua
-- Direct player alert
exports['5M_Phone']:PresentAlertToPlayer(src, {
    app = 'System',
    title = 'DMV',
    body = 'Your driver license expires tomorrow.',
    icon = 'system',
    openApp = 'mail',
})

-- Notification respecting per-app mute
exports['5M_Phone']:SendNotification(src, {
    app = 'Messages',
    title = 'Bank of Los Santos',
    body = '$2,500 transferred to your account.',
    icon = 'messages',
    openApp = 'payus',
})

-- Offline or online by Citizen ID
exports['5M_Phone']:SendNotificationToCitizen(citizenid, {
    app = 'Mail',
    title = 'Court Notice',
    body = 'You have a scheduled court date.',
    icon = 'mail',
    openApp = 'mail',
})

-- Broadcast Amber Alert / Emergency Alert to all players
exports['5M_Phone']:EmergencyNotification(source, {
    title = 'Severe Weather Warning',
    message = 'Tsunami advisory issued for Pacific Coast.',
})

SMS Messages

Lua
-- From player source
exports['5M_Phone']:SendMessage(source, '5551234567', 'Your table is ready.')
exports['5M_Phone']:SendSMS(source, '5551234567', 'Your table is ready.')

-- From company number
exports['5M_Phone']:SendMessage('5550001111', '5551234567', 'Automated appointment confirmation.')

Mail Delivery

Lua
-- To online player
exports['5M_Phone']:SendMail(src, {
    sender = 'City Hall',
    subject = 'Vehicle Tax Receipt',
    message = 'Your vehicle tax payment was processed.',
})

-- To offline citizen ID
exports['5M_Phone']:SendMailToCitizen(citizenid, {
    sender = 'Police Department',
    subject = 'Impound Notice',
    message = 'Vehicle parked at police lot.',
})

-- To specific @5mphone.com address
exports['5M_Phone']:SendMailToEmail('alex@5mphone.com', {
    sender = 'noreply',
    subject = 'Welcome',
    message = 'Your mailbox has been configured.',
})

Dispatch CAD Pings

Lua
exports['5M_Phone']:DispatchNotify({
    message = '10-13 Shots fired',
    codeName = 'shooting',
    code = '10-13',
    icon = 'fas fa-gun',
    priority = 1,
    flash = true,
    radius = 0,
    coords = { x = 0.0, y = 0.0, z = 72.0 },
    street = 'Olympic Fwy, Downtown',
    heading = 'North',
    jobs = { 'leo', 'police' },
    vehicle = 'Sultan',
    plate = 'ABC 123',
    information = 'Multiple shots heard',
})

Complete Advanced Server Exports Table

ExportSignatureDescription
GetConfig() -> tableReturns server configuration
GetCellTowers() -> vector3[]Tower coordinates list
FormatNumber(number: string) -> stringFormatted phone number string
AirShare(sender, target, type, data)AirDrop transfer between two players
ContainsBlacklistedWord(source, text) -> booleanWord filter check
GetSocialMediaUsername(source, app) -> string?Gets xBird / Insta / DarkChat username
ToggleVerified(app, username, state?)Grants blue verified checkmark
IsVerified(app, username) -> booleanChecks verified status
ChangePassword(app, username, password)Updates social account password
PostBirdy(data: table)Posts on xBird
PostInstaPic(data: table)Posts on InstaPic
FactoryReset(phoneNumber: string)Erases phone records from database
GetEquippedPhoneNumber(source: number) -> string?Active number of player
GetSourceFromNumber(phoneNumber: string) -> number | falseOnline source ID by phone number
HasPhoneItem(source, phoneNumber?) -> booleanVerifies phone possession
SendNotification(target, data)Accepts source ID OR phone number
NotifyEveryone(data: table)Broadcasts alert to all players
EmergencyNotification(source, data)Broadcasts amber / emergency alert
AddContact(phoneNumber, data)Adds contact to user's phone
AddTransaction(phoneNumber, amount, title, image?)PayUs transaction ledger entry
GetPin(phoneNumber)Gets device lock PIN
ResetSecurity(phoneNumber)Resets PIN & FaceID security
SendMail(data: table | (src, mail))Sends email (supports LB & 5M shapes)
SendMessage(from, to, msg, attachments)Sends SMS message
SentMoney(from, to, amount)Sends cash transfer in SMS
SendCoords(from, to, coords)Sends location card in SMS
SendDarkChatMessage(channelId, sender, text)Sends DarkChat encrypted message
CreateDarkChatChannel(name, password?)Creates DarkChat burner channel
SaveBattery(phoneNumber, percent)Saves battery level
CreateCall(fromNumber, toNumber)Initiates call between two numbers
EndCall(callId)Terminates active call
AddCrypto(source, coin, amount)Credits cryptocurrency
RemoveCrypto(source, coin, amount)Debits cryptocurrency
RegisterCallback(name, cb)Registers two-way async callback
PreviousDocumentationClient ExportsNextDocumentationState Bags & Events

On this page

  • Core & Identity Exports
  • Push Notifications
  • SMS Messages
  • Mail Delivery
  • Dispatch CAD Pings
  • Complete Advanced Server Exports Table