Client

Calling

---Check & Cancel Current Call
---If export triggered the call will be cancelled if there is an ongoing call 
exports['snappy-phone']:CheckCallStatus()

Contact

---Share contact of yourself or other person to any nearby person
---@param data (optional) { type = 'personal', -- 'personal', 'other' number = 'OTHER_NUMBER', -- only if type = 'other' name = 'OTHER_NAME' -- only if type = 'other' }
TriggerEvent('phone:client:sharePhoneNumber', data)

Notifications

local data = {
   icon = 'user', --https://fontawesome.com/search?o=r&m=free
   title = 'DEMO TITLE',
   description = 'Testing the description',
   duration = 5000, -- 5000 ms : 5 secs
}
exports['snappy-phone']:sendNotification(data)
local data = {
   icon = 'user', --https://fontawesome.com/search?o=r&m=free
   title = 'DEMO TITLE',
   description = 'Testing the description',
   duration = 5000, -- 5000 ms : 5 secs
}
local isChecked = exports['snappy-phone']:sendConfirmation(data)
if isChecked then
    -- pressed check
else
    -- pressed cross
end

Mail

-- Sends a custom email from a given sender to one or more recipients.
---@param data {sender?: string; subject?: string; body?: string, recipients: {source?: number; identifier?: string}[]}: A table containing sender subject, body, and recipients.
TriggerServerEvent('snappy-phone:server:sendCustomMail', data)

Phone

---Checks if phone is opened or closed
local isOpen = exports['snappy-phone']:isOpen()
isOpen: true -- Phone is open
isOpen: false -- Phone is closed
---Opens the phone upon triggered
exports['snappy-phone']:openPhone()
---Closes the phone upon triggered
exports['snappy-phone']:closePhone()
---Export which returns if player has app installed or not
---@param appName string
---@return boolean true / false
exports['snappy-phone']:hasAppInstalled(appName)

Party

local myPartyData = LocalPlayer.state.partyData

myPartyData.inParty ---returns true/false depending on if they are in party or not
myPartyData.currentJob ---returns current job name

if not myPartyData then
    -- not in party and not doing any work    
end

Last updated