Server
data is { sender, subject, message, address, from, title, description, app }. lb-phone looks up the equipped phone email when address is omitted. sky_phone mail and messages return false, and so do qb-phone messages. qs-smartphone and qs-smartphone-pro cannot look up a player by number. qs-smartphone-pro has no call checks, and qb-phone can end a call but not check one. okokPhone call checks yield for up to 5 seconds while that player's client answers.
SendPhoneMail
Parameters
sourcenumber— server iddatatable—{ sender, subject, message, address }
Returns
boolean
Example
local sent = Bridge.SendPhoneMail(source, {
sender = 'City Hall',
subject = 'Licence',
message = 'Approved.',
address = 'jane@mail.com',
})
if not sent then
Bridge.Notify(source, { description = 'Mail failed', kind = 'error' })
endSendPhoneNotification
Parameters
sourcenumberdatatable—{ title, description, app }
Returns
boolean
Example
Bridge.SendPhoneNotification(source, {
title = 'City Hall',
description = 'Approved.',
app = 'Mail',
})SendPhoneMessage
Parameters
sourcenumber— the player who receives the messagedatatable—{ from, sender, message }.fromis the sender number and defaults tosender.
Returns
boolean
Example
Bridge.SendPhoneMessage(source, {
from = '8294',
sender = 'Downtown Cab Co.',
message = 'Your taxi has arrived.',
})GetPhoneNumber
Parameters
sourcenumber
Returns
string|nil — nil when the player has no number
Example
local number = Bridge.GetPhoneNumber(source)
if number then
print(('Player %d uses %s'):format(source, number))
endGetSourceByPhone
Parameters
numberstring
Returns
number|nil — nil when the owner is offline
Example
local target = Bridge.GetSourceByPhone('5550142')
if target then
Bridge.Notify(target, { description = 'Your order is ready' })
endIsInPhoneCall
Parameters
sourcenumber
Returns
boolean
Example
if Bridge.IsInPhoneCall(source) then
Bridge.Notify(source, { description = 'Finish your call first', kind = 'error' })
endEndPhoneCall
Parameters
sourcenumber
Returns
boolean — false when the player was not in a call
Example
AddEventHandler('myjail:jailed', function(source)
Bridge.EndPhoneCall(source)
end)