add jpr-phonesystem support

Update wrapper.lua - Added code in for JPR-Phonesystem, Not sure if I should have called the QBCore export a different way, JPR-Phone system only supports qbcore and esx, 

Info for mails taken directly from their docs https://joaos-organization-3.gitbook.io/jpresources-documentation/installation/phone-system/events-and-commands#phone-mails
This commit is contained in:
Peter
2024-02-15 10:45:50 +00:00
committed by GitHub
parent 42b109a5f1
commit 4670d87c96

View File

@@ -1291,6 +1291,9 @@ function sendPhoneMail(data) local phoneResource = ""
elseif GetResourceState("qb-phone"):find("start") then phoneResource = "qb-phone"
TriggerServerEvent('qb-phone:server:sendNewMail', data)
elseif GetResourceState("jpr-phonesystem"):find("start") then phoneResource = "jpr-phonesystem"
TriggerServerEvent(GetCurrentResourceName()..":jpr:SendMail", data)
end
if phoneResource ~= "" then if Config.System.Debug then print("^6Bridge^7[^3"..phoneResource.."^7]: ^2Sending mail to player") end
@@ -1323,6 +1326,19 @@ RegisterNetEvent(GetCurrentResourceName()..":yflip:SendMail", function(data)
}, 'source', src)
end)
RegisterNetEvent(GetCurrentResourceName()..":jpr:SendMail", function(data)
local QBCore = exports['qb-core']:GetCoreObject()
local src = source
local Player = QBCore.Functions.GetPlayer(src)
TriggerEvent('jpr-phonesystem:server:sendEmail', {
Assunto = data.subject, -- Subject
Conteudo = data.message, -- Content
Enviado = data.sender, -- Submitted by
Destinatario = Player.PlayerData.citizenid, -- Target
Event = {}, -- Optional
})
end)
function registerCommand(command, options)
if GetResourceState(OXLibExport):find("start") then
if Config.System.Debug then print("^6Bridge^7: ^2Registering ^3Command^2 with ^7"..OXLibExport, command) end