Exports
ARS Phone provides a small set of public integration points for other FiveM resources. This page documents the exports, callbacks, events, and notification utilities intended for cross-resource use.
Server Exports
Section titled “Server Exports”SendEmail
Section titled “SendEmail”Send an email to a player’s phone from another resource.
---@param recipientCitizenId string - The citizenid of the recipient---@param subject string - Email subject---@param content string - Email content/body---@param fromName string|nil - Sender name (optional, defaults to 'Unknown')---@return boolean - Returns true on success, false on failurelocal success = exports['ars_phone']:SendEmail(recipientCitizenId, subject, content, fromName)Example - Sending a bill notification:
local recipient = 'CHAR123456789'local subject = 'New Bill Received'local content = 'Your electric bill of $50.00 is due on 2026-03-30.'local fromName = 'Electric Company'
local success = exports['ars_phone']:SendEmail(recipient, subject, content, fromName)
if success then print('Email sent successfully')else print('Failed to send email')endExample - Welcome email for new players:
RegisterNetEvent('character:created', function(playerId, citizenId) exports['ars_phone']:SendEmail( citizenId, 'Welcome to Los Santos!', 'Welcome to our server! Check out the Services app for job opportunities.', 'Server Administration' )end)Server Callbacks
Section titled “Server Callbacks”These callbacks are registered server-side and can be called from client scripts using lib.callback.await().
HasPhone
Section titled “HasPhone”Check if a player has a phone item. Always returns true when Config.RequirePhoneItem = false.
---@param source number - Player server ID---@return boolean - Returns true if player has phone, false otherwiselocal hasPhone = lib.callback.await('ars_phone:server:HasPhone', source)Example - Gate a feature behind phone ownership:
RegisterCommand('sendnotif', function(source) local hasPhone = lib.callback.await('ars_phone:server:HasPhone', source)
if hasPhone then TriggerClientEvent('ars_phone:client:sendNotifMessage', source, { message = 'You have a new message!' }) else TriggerClientEvent('ox_lib:notify', source, { type = 'error', description = 'You need a phone to use this feature.' }) endend)GetWebhook
Section titled “GetWebhook”Get the configured webhook URL (Discord) or API key (FiveManage) for photo uploads.
---@return string|nil - Returns webhook URL/API key or nil if not configuredlocal webhook = lib.callback.await('ars_phone:server:GetWebhook', false)Server Events
Section titled “Server Events”SendEmailExternal
Section titled “SendEmailExternal”Send an email using a server event instead of the export. Useful when triggering from client-side code.
TriggerServerEvent('ars_phone:server:SendEmailExternal', recipientCitizenId, subject, content, fromName)Example - Sending a system announcement to all players:
RegisterCommand('announce', function(source, args, rawCommand) local message = table.concat(args, ' ', 2)
for _, player in pairs(GetPlayers()) do local citizenId = GetPlayerIdentifier(player, 0):gsub('license:', '') TriggerServerEvent('ars_phone:server:SendEmailExternal', citizenId, 'Server Announcement', message, 'System Admin') endend, 'admin')Client Events
Section titled “Client Events”These events are triggered from server-side code to display notifications on a player’s phone.
sendNotifMessage
Section titled “sendNotifMessage”Send a standard notification message to the player’s phone.
TriggerClientEvent('ars_phone:client:sendNotifMessage', source, { message = 'Notification text here'})Example - Job alert system:
RegisterServerEvent('police:alertOfficers', function(alertType, location) local officers = GetPlayersWithJob('police')
for _, officerId in pairs(officers) do TriggerClientEvent('ars_phone:client:sendNotifMessage', officerId, { message = string.format('10-4: %s reported at %s', alertType, location) }) endend)sendNotifIncomingCall
Section titled “sendNotifIncomingCall”Send an incoming call notification to the player’s phone.
TriggerClientEvent('ars_phone:client:sendNotifIncomingCall', targetSource, { caller = 'Caller Name', anonymous = false, is_anonim = false})sendNotifStartCall
Section titled “sendNotifStartCall”Notify a player that their outgoing call has started.
TriggerClientEvent('ars_phone:client:sendNotifStartCall', source, { to_number = '555-1234', to_name = 'John Doe'})setInCall
Section titled “setInCall”Set the player’s call state. Used for managing active call UI.
TriggerClientEvent('ars_phone:client:setInCall', source, { inCall = true, channelId = 'call-channel-123'})closeCall
Section titled “closeCall”Close the call UI for a specific player (used when the other party ends the call).
TriggerClientEvent('ars_phone:client:closeCall', targetSource)closeCallSelf
Section titled “closeCallSelf”Close the call UI for the calling player (self-hangup).
TriggerClientEvent('ars_phone:client:closeCallSelf', source)Notification Utilities
Section titled “Notification Utilities”ARS Phone provides a shared Notification utility for sending standardized phone notifications from server-side scripts. The notification system supports three display types: mini, standard, and large.
Notification.Send
Section titled “Notification.Send”Send a notification to a single player’s phone.
---@param source number - Player server ID---@param from string - Sender name (e.g., "Bank", "System", "Delivery")---@param message string - Notification message text---@param senderApp string|nil - App identifier (defaults to "System")---@param notificationType string|nil - "mini", "standard", or "large" (defaults to "mini")---@param avatar string|nil - Avatar URL (used with "large" type)Notification.Send(source, from, message, senderApp, notificationType, avatar)Example:
-- Simple notificationNotification.Send(source, "Bank", "Transaction completed", "bank")
-- Large notification with avatarNotification.Send(source, "Lovy", "New match!", "lovy", "large", "/images/avatar.png")Notification.SendToMany
Section titled “Notification.SendToMany”Send a notification to multiple players at once.
---@param sources table|number - Array of player source IDs or a single source---@param from string - Sender name---@param message string - Notification message text---@param senderApp string|nil - App identifier---@param notificationType string|nil - "mini", "standard", or "large"---@param avatar string|nil - Avatar URLNotification.SendToMany(sources, from, message, senderApp, notificationType, avatar)Example:
local officers = {3, 7, 12}Notification.SendToMany(officers, "Dispatch", "10-31: Pursuit in progress", "services", "standard")Notification.SendToJob
Section titled “Notification.SendToJob”Send a notification to all online players with a specific job.
---@param jobName string - The job name to filter by---@param from string - Sender name---@param message string - Notification message text---@param senderApp string|nil - App identifier---@param notificationType string|nil - "mini", "standard", or "large"---@param avatar string|nil - Avatar URLNotification.SendToJob(jobName, from, message, senderApp, notificationType, avatar)Example:
-- Notify all EMS playersNotification.SendToJob("ambulance", "Dispatch", "Medical emergency at Legion Square", "services", "standard")Admin Commands
Section titled “Admin Commands”ARS Phone registers two admin commands using lib.addCommand with ox_lib permission restrictions.
| Command | Permission | Description |
|---|---|---|
/mailbroadcast [subject] [message] |
group.admin |
Send a broadcast email to all online players |
/darkmarket-restock |
group.admin |
Restock all dark market items |
Note: This guide is written by a third party. If you find any incorrect or outdated information, please contact us on Discord so we can update it for you.