# Config

{% tabs %}
{% tab title="config.lua" %}

```lua
Config = {}

Config.Core = "qb-core" -- Core Name
Config.Inventory = "qb" -- "qb" or "ox"
Config.Notification = "qb" -- "qb" or "ox"
Config.KeyToRob = 38 -- "E"
Config.Cooldown = 300 -- 5 minutes
Config.StealingTime = { min = 5000, max = 10000 } -- 5 seconds to 10 seconds

Config.ValidWeapons = { -- List of valid weapons to rob npc's
    `weapon_pistol`
}

Config.CopsSettings = { -- Call cops settings
    callCops = true, -- Enable or disable call cops
    policeJobs = { "police", "sheriff", "state" }, -- List of police jobs
    amountOnline = 0, -- Amount of police online to call
    percentageCall = 100, -- Percentage to call cops
}

Config.Rewards = {
    Type = "item", -- Available: "money", "item"
    MinMoney = 200, -- Minimum money that can come out (Both normal money and dirty money)
    MaxMoney = 600, -- Maximum money that can go out (Both normal money and dirty money)
    Item = { -- List of available items can drop on npc's
       [1] = "phone",
       [2] = "water_bottle",
    },
    ItemAmount = { -- Amount of the item when rob npc
        MinItem = 1,
        MaxItem = 2,
    }
}
```

{% endtab %}

{% tab title="functions.lua" %}

```lua
function Notification(text, type, lenght)
    if Config.Notification == "qb" then
        QBCore.Functions.Notify(text, type, lenght)
    elseif Config.Notification == "ox" then
        lib.notify({ title = 'Notification', description = text, type = type })
    end
end


function CallCops()
    if GetResourceState("ps-dispatch") == "started" then
        local pCoords = GetEntityCoords(PlayerPedId())
        exports["ps-dispatch"]:CustomAlert({
            coords = pCoords,
            message = "911 - Suspicious Activity",
            dispatchCode = "10-10 Suspicious Activity",
            description = "possibly committing a crime",
            gender = true,
            radius = 0,
            sprite = 156,
            color = 1,
            scale = 1.2,
            length = 3,
        })
    elseif GetResourceState("cd_dispatch") == "started" then
        local data = exports['cd_dispatch']:GetPlayerInfo()
        TriggerServerEvent('cd_dispatch:AddNotification', {
            job_table = {'police'},
            coords = data.coords,
            title = '10-10 - Suspicious Activity',
            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 - Suspicious Activity',
                time = (5*60*1000),
                sound = 1,
            }
        })
    elseif GetResourceState("qs-dispatch") == "started" then
        local pCoords = GetEntityCoords(PlayerPedId())
        TriggerServerEvent('qs-dispatch:server:CreateDiapatchCall', {
             job = 'police',
             callLocation = pCoords,
             callCode = {code = '911 - Suspicious Activity', snippet = '10-10 Suspicious Activity'},
             message = 'possibly committing a crime',
             flashes = 'Boolean',
             image = 'URL.png',
             blip = {
                sprite = 110,
                scale = 1.5,
                colour = 1,
                flashes = true,
                text = '10-10 Suspicious Activity',
                time = (6*60*1000),-- 6 minutes
            }
        })
    end
end
```

{% endtab %}
{% endtabs %}
