Config

Config = {}

Config.Locale = GetConvar('esx:locale', 'fr')

Config.jobCops = 'police'

Config.ActiveCustomDispatch = false
Config.TimeNotificationDispatch = 10000
Config.Dispatch = function(coords)
    local data = exports['cd_dispatch']:GetPlayerInfo()
    TriggerServerEvent('cd_dispatch:AddNotification', {
        job_table = {'police', }, 
        coords = data.coords,
        title = '10-15 - Store Robbery',
        message = 'A '..data.sex..' robbing a store at '..data.street, 
        flash = 0,
        unique_id = data.unique_id,
        sound = 1,
        blip = {
            sprite = 431, 
            scale = 1.2, 
            colour = 3,
            flashes = false, 
            text = '911 - Store Robbery',
            time = 5,
            radius = 0,
        }
    })
end

Config.CallCops = 50 -- Percent to call police (If set 100, police is notified always)

Config.items = {
    {
       itemName = 'bandage',
       itemRandomAmount = {1, 3}
    },
    {
       itemName = 'black_money',
       itemRandomAmount = {1, 2}
    },
    {
        itemName = 'money',
        itemRandomAmount = {1, 6}
    },
    {
        itemName = 'rope',
        itemRandomAmount = {1, 8} 
    },
    {
        itemName = 'water',
        itemRandomAmount = {1, 4}
    },
}

Config.Notify = function(key, source, ...)
    local service = IsDuplicityVersion()
    local description, data
    if ... then
         description = (Config.Notifications[key].description):format(...)
         data = {
            id = Config.Notifications[key].id,
            title = Config.Notifications[key].title,
            description = description,
            position = Config.Notifications[key].position,
            style = Config.Notifications[key].style,
            icon = Config.Notifications[key].icon,
            type = Config.Notifications[key].type,
            iconColor = Config.Notifications[key].iconColor
         }
    end
    lib.notify(service and source or (data or Config.Notifications[key]), service and (data or Config.Notifications[key]))
end

Last updated