Exports
Phone
Server

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

  • source number — server id
  • data table — { 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' })
end

SendPhoneNotification

Parameters

  • source number
  • data table — { title, description, app }

Returns

boolean

Example

Bridge.SendPhoneNotification(source, {
    title = 'City Hall',
    description = 'Approved.',
    app = 'Mail',
})

SendPhoneMessage

Parameters

  • source number — the player who receives the message
  • data table — { from, sender, message }. from is the sender number and defaults to sender.

Returns

boolean

Example

Bridge.SendPhoneMessage(source, {
    from = '8294',
    sender = 'Downtown Cab Co.',
    message = 'Your taxi has arrived.',
})

GetPhoneNumber

Parameters

  • source number

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

GetSourceByPhone

Parameters

  • number string

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

IsInPhoneCall

Parameters

  • source number

Returns

boolean

Example

if Bridge.IsInPhoneCall(source) then
    Bridge.Notify(source, { description = 'Finish your call first', kind = 'error' })
end

EndPhoneCall

Parameters

  • source number

Returns

boolean — false when the player was not in a call

Example

AddEventHandler('myjail:jailed', function(source)
    Bridge.EndPhoneCall(source)
end)
Join Our Discord