Script Snippets

Renewed Phone Compatibility

Edit qb-phone/server/mail.lua and add the code below at the bottom of the file.

RegisterNetEvent('qb-phone:server:sendNewMailToOffline', function(citizenid, mailData)
  TriggerEvent('qb-phone:server:sendNewMail', mailData, citizenid)
end)

ESX 1.9+ getSharedObject Compatibility

Step 1:

Edit es_extended/server/common.lua and add the code below at the top of the file.

AddEventHandler('esx:getSharedObject', function(cb)
  cb(ESX)
end)

Step 2:

Edit es_extended/client/common.lua and add the code below at the top of the file.

AddEventHandler('esx:getSharedObject', function(cb)
  cb(ESX)
end)

QBPhone (Using Export to send mail to offline)

If your version of QBPhone uses an export to send a mail to a player via citizen ID then you can make a small edit to the main.lua in the server folder.

-- Add this code below under exports("sendNewMailToOffline",sendNewMailToOffline) which is on line 160.

RegisterNetEvent('qb-phone:server:sendNewMailToOffline', function(citizenid, mailData)
  exports['qb-phone']:sendNewMailToOffline(citizenid, mailData)
end)

More snippets to come...

Last updated