Functions

local QBCore = exports[Config.Core]:GetCoreObject()

function Notify(msg)
    QBCore.Functions.Notify(msg)
end

function CallCops()
    if Config.Dispatch == 'cd_dispatch' then
        local data = exports['cd_dispatch']:GetPlayerInfo()
        TriggerServerEvent('cd_dispatch:AddNotification', {
            job_table = {'police'},
            coords = data.coords,
            title = '10-10 - Store Robbery',
            message = 'A '..data.sex..' possibly committing a crime '..data.street,
            flash = 0,
            unique_id = tostring(math.random(0000000,9999999)),
            blip = {
                sprite = 156,
                scale = 1.2,
                colour = 1,
                flashes = false,
                text = '911 - Store Robbery',
                time = (5*60*1000),
                sound = 1,
            }
        })
    elseif Config.Dispatch == 'ps-dispatch' then
        local pCoords = GetEntityCoords(PlayerPedId())
        exports["ps-dispatch"]:CustomAlert({
            coords = pCoords,
            message = "911 - Store Robbery",
            dispatchCode = "10-10 Store Robbery",
            description = "possibly committing a crime",
            gender = true,
            radius = 0,
            sprite = 156,
            color = 1,
            scale = 1.2,
            length = 3,
        })
    elseif Config.Dispatch == 'qs-dispatch' then
        local pCoords = GetEntityCoords(PlayerPedId())
        TriggerServerEvent('qs-dispatch:server:CreateDiapatchCall', {
             job = 'police',
             callLocation = pCoords,
             callCode = {code = '911 - Store Robbery', snippet = '10-10 Store Robbery'},
             message = 'possibly committing a crime',
             flashes = 'Boolean',
             image = 'URL.png',
             blip = {
                sprite = 110,
                scale = 1.5,
                colour = 1,
                flashes = true,
                text = '10-10 Store Robbery',
                time = (6*60*1000),-- 6 minutes
            }
        })
    end
end

function Email()
    if Config.Phone == "qb-phone" then
        TriggerServerEvent("qb-phone:server:sendNewMail", { sender = Language.Email.Sender, subject = Language.Email.Subject, message = Language.Email.Message, })
    elseif Config.Phone == "qs-smartphone" then
        TriggerServerEvent("qs-smartphone:server:sendNewMail", { sender = Language.Email.Sender, subject = Language.Email.Subject, message = Language.Email.Message, })
    elseif Config.Phone == "gksphone" then
        TriggerServerEvent("gksphone:NewMail", { sender = Language.Email.Sender, image = '/html/static/img/icons/mail.png', subject = Language.Email.Subject, message = Language.Email.Message, })
    elseif Config.Phone == "renewed-phone" then
        TriggerServerEvent("qb-phone:server:sendNewMail", { sender = Language.Email.Sender, image = '/html/static/img/icons/mail.png', subject = Language.Email.Subject, message = Language.Email.Message, button = {}, })
    elseif Config.Phone == "jpr-phone" then
        TriggerServerEvent("jpr-newphone:server:sendNewMailFix", { sender = Language.Email.Sender, subject = Language.Email.Subject, message = Language.Email.Message})
    end
end

Last updated