Skip to content

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.

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 failure
local 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')
end

Example - 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)

These callbacks are registered server-side and can be called from client scripts using lib.callback.await().

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 otherwise
local 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.'
})
end
end)

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 configured
local webhook = lib.callback.await('ars_phone:server:GetWebhook', false)

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')
end
end, 'admin')

These events are triggered from server-side code to display notifications on a player’s phone.

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)
})
end
end)

Send an incoming call notification to the player’s phone.

TriggerClientEvent('ars_phone:client:sendNotifIncomingCall', targetSource, {
caller = 'Caller Name',
anonymous = false,
is_anonim = false
})

Notify a player that their outgoing call has started.

TriggerClientEvent('ars_phone:client:sendNotifStartCall', source, {
to_number = '555-1234',
to_name = 'John Doe'
})

Set the player’s call state. Used for managing active call UI.

TriggerClientEvent('ars_phone:client:setInCall', source, {
inCall = true,
channelId = 'call-channel-123'
})

Close the call UI for a specific player (used when the other party ends the call).

TriggerClientEvent('ars_phone:client:closeCall', targetSource)

Close the call UI for the calling player (self-hangup).

TriggerClientEvent('ars_phone:client:closeCallSelf', source)

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.

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 notification
Notification.Send(source, "Bank", "Transaction completed", "bank")
-- Large notification with avatar
Notification.Send(source, "Lovy", "New match!", "lovy", "large", "/images/avatar.png")

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 URL
Notification.SendToMany(sources, from, message, senderApp, notificationType, avatar)

Example:

local officers = {3, 7, 12}
Notification.SendToMany(officers, "Dispatch", "10-31: Pursuit in progress", "services", "standard")

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 URL
Notification.SendToJob(jobName, from, message, senderApp, notificationType, avatar)

Example:

-- Notify all EMS players
Notification.SendToJob("ambulance", "Dispatch", "Medical emergency at Legion Square", "services", "standard")

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.