add jpr-phonesystem support

This commit is contained in:
Jim Shield
2024-02-16 22:45:22 +00:00
committed by GitHub
parent f1ae24d0fe
commit 89f6f6deb0

View File

@@ -1293,6 +1293,10 @@ function sendPhoneMail(data) local phoneResource = ""
TriggerServerEvent('qb-phone:server:sendNewMail', data)
end
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
else print("^6Bridge^7: ^1ERROR ^2Sending mail to player ^7 - ^2No supported phone found") end
end
@@ -1323,6 +1327,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