# xakra\_bankrobbery

## Requirements

* [oxmysql](https://github.com/overextended/oxmysql)
* [vorp\_core](https://github.com/VORPCORE/vorp-core-lua)
* [vorp\_inventory](https://github.com/VORPCORE/vorp_inventory-v2)
* vorp\_banking or bank script (use the same database table 'bank\_users') | module\_bank | syn\_society | mega\_companies | dl\_society
* [qadr-safe](https://github.com/XakraD/qadr-safe)

***

## Installation

1. Copy the script into a folder (to choose) from the 'resources' folder.
2. Add 'ensure xakra\_bankrobbery' in the 'Resources.cfg' document.
3. Check the config.lua file and configure to adapt the script.
4. Configure the database banks and bank names in config.lua.

***

## Config & Framework

<details open>

<summary>config.lua</summary>

{% code expandable="true" %}

```lua
Config = {}

Config.Webhook = '' -- VORP WEBWOOK

Config.Language = 'en'	-- 'es'/'en'/...

-- KEYS: https://github.com/femga/rdr3_discoveries/tree/master/Controls
Config.KeyRobbery = 0x760A9C6F -- Key to start the robbery and collect money

Config.RobberyCooldown = {  -- GLOBAL
    Simultaneous = false,    -- true or false (Allows multiple robberies at the same time)
    Enable = false,  -- true (Enable cooldown upon completion of a robbery) or false (you will not be able to robbery on completion of a robbery until you restart the server or the script)
    Time = 7200,  -- number (Seconds to start a robbery again, only if 'Enable' is true)
}

Config.Blip = {
    Time = 500000,  -- Time to show the blip to the sheriffs (Milliseconds)
    Radius = 100.0,  -- Blip radius
    Delay = 5000, -- Time that the blip about the thief will appear again (Milliseconds)
    Color = 'BLIP_MODIFIER_MP_COLOR_8', -- BLIP COLORS: https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/blip_modifiers
}

-- COLORS: https://github.com/femga/rdr3_discoveries/tree/master/useful_info_from_rpfs/colours
Config.HUDColors = {
	Icon = 'COLOR_PLATFORM_GREEN',
	Progress = 'COLOR_PLATFORM_GREEN',
}

-- List of robbery points
Config.Banks = {
    {
        name = 'Bank of Saint Denis', --  Location name is use in the alerts and the robbery prompt
        FloorMarkColor = { r = 0, g = 128, b = 0, alpha = 50, radius = 1 }, -- Floor mark and location range
        coords = vector3(2643.86, -1305.39, 51.25), -- vector3 (Robbery coordinates)
        Notify = 'Several individuals have been seen robbing the Saint Denis bank',  -- Text used in notifications for the Notify and NotifyJobs functions in framework/server.lua
        ExecuteCommand = 'alertpolice Several individuals have been seen robbing the Saint Denis bank', -- text (Command to be executed during the robbery) or false
        SafeMinigame = 5,  -- number (number of qadr-safe locks) or false (The thief will use a bomb)
        CollectingTime = 300,   -- (seconds) Time it will take the player to collect the money
        Cooldown = {
            Enable = false,  -- true (Enable cooldown upon completion of a robbery) or false (you will not be able to robbery on completion of a robbery until you restart the server or the script)
            Time = 18000,  -- number (Seconds to start a robbery again, only if 'Enable' is true)
        },
        JobsRequired = {
            OnDuty = false,	-- Get on duty jobs (modifiable function in 'framework/server.lua')
            Amount = 1, -- number (Number of players required with the job from the JobsRequired list to steal)
            Jobs = {    -- job list or false
                'sheriff', 
                'police',
            },
        },
        ItemsRequired = {  -- List of items needed to rob the bank or false
            { label = 'Dynamite', item = 'dynamite', amount = 1 },
            -- { label = 'Example', item = 'example', amount = 5 },
        },
        Robbery = {
            -- DB = {  -- Database theft reward or false
            --     type = 'bank', -- 'bank', 'syn_society', 'mega_companies', 'module_bank', 'dl_society'
            --     name =  'Saint Denis', -- Name in the database of the bank/company in the database
            --     amount = 'money', -- 'money', 'gold', or 'both' (Choose the currency the thief will receive when stealing in the database)
            --     percentage = 10, -- number (X/100 percentage you will steal from the bank/company in the database)
            -- },
            Rewards = { -- Random reward list for completing a robbery
                {
                    Currency = {    -- List of reward currency for stealing or false
                        {
                            label = '$',	-- Notification item label
                            currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                            amount = { 100, 150 },	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        },
                        -- {
                        --     label = 'Example',	-- Notification item label
                        --     currency = 2,	-- 0 = money, 1 = gold, 2 = rol
                        --     amount = 1,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        -- },
                    },
                    Items = {   -- List of reward items for stealing or false
                        { label = 'Iron ', item = 'iron', amount = { 10, 15 } },
                        -- { label = 'Example', item = 'example', amount = 5 },
                    },
                },
                -- {
                --     Currency = {    -- List of reward currency for stealing or false
                --         {
                --             label = '$',	-- Notification item label
                --             currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                --             amount = 100,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                --         },
                --     },
                --     Items = {   -- List of reward items for stealing or false
                --         { label = 'Iron ', item = 'iron', amount = 5 },
                --         -- { label = 'Example', item = 'example', amount = 5 },
                --     },
                -- },
            },
        },
        NPCs = {    -- List of enemies when stealing or false / combats NPCS ('sniper', 'horse', 'wagongatlin' or false)
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2622.21, -1325.34, 56.14, 357.76), weapon = 'WEAPON_SNIPERRIFLE_CARCANO', blip = true, combat = 'sniper' },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2595.37, -1250.87, 58.16, 235.44), weapon = 'WEAPON_SNIPERRIFLE_CARCANO', blip = true, combat = 'sniper' },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2654.35, -1327.88, 53.3, 133.04), weapon = 'WEAPON_SNIPERRIFLE_CARCANO', blip = true, combat = 'sniper' },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2562.73, -1268.08, 49.93, 267.87), weapon = 'WEAPON_REPEATER_WINCHESTER', blip = true, combat = 'horse' },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2590.26, -1362.32, 45.16, 0.57), weapon = 'WEAPON_REPEATER_WINCHESTER', blip = true, combat = 'horse' },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2601.47, -1145.47, 51.54, 188.01), weapon = 'WEAPON_SHOTGUN_PUMP', blip = true, combat = 'wagongatlin' },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2574.5, -1324.61, 47.22, 202.43), weapon = 'WEAPON_SHOTGUN_REPEATING', blip = true, combat = false },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2681.04, -1314.06, 48.33, 134.48), weapon = 'WEAPON_SHOTGUN_REPEATING', blip = true, combat = false },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2700.74, -1282.87, 49.52, 9.03), weapon = 'WEAPON_SHOTGUN_PUMP', blip = true, combat = false },
            { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2657.09, -1243.19, 51.51, 291.52), weapon = 'WEAPON_SHOTGUN_PUMP', blip = true, combat = false },
        },
    },
    {
        name = 'Bank of Blackwater', --  Location name is use in the alerts and the robbery prompt
        FloorMarkColor = { r = 0, g = 128, b = 0, alpha = 50, radius = 1 }, -- Floor mark and location range
        coords = vector3(-820.77, -1274.22, 42.65), -- vector3 (Robbery coordinates)
        Notify = 'Several individuals have been seen robbing the Blackwater bank with explosives',  -- Text used in notifications for the Notify and NotifyJobs functions in framework/server.lua
        ExecuteCommand = 'alertpolice Several individuals have been seen robbing the Blackwater bank with explosives', -- text (Command to be executed during the robbery) or false
        SafeMinigame = false,  -- number (number of qadr-safe locks) or false (The thief will use a bomb)
        CollectingTime = 300,   -- (seconds) Time it will take the player to collect the money
        Cooldown = {
            Enable = false,  -- true (Enable cooldown upon completion of a robbery) or false (you will not be able to robbery on completion of a robbery until you restart the server or the script)
            Time = 18000,  -- number (Seconds to start a robbery again, only if 'Enable' is true)
        },
        JobsRequired = {
            OnDuty = false,	-- Get on duty jobs (modifiable function in 'framework/server.lua')
            Amount = 1, -- number (Number of players required with the job from the JobsRequired list to steal)
            Jobs = {    -- job list or false
                'sheriff', 
                'police',
            },
        },
        ItemsRequired = {  -- List of items needed to rob the bank or false
            { label = 'Dynamite', item = 'dynamite', amount = 1 },
            -- { label = 'Example', item = 'example', amount = 5 },
        },
        Robbery = {
            -- DB = {  -- Database theft reward or false
            --     type = 'bank', -- 'bank', 'syn_society', 'mega_companies', 'module_bank', 'dl_society'
            --     name =  'Blackwater', -- Name in the database of the bank/company in the database
            --     amount = 'money', -- 'money', 'gold', or 'both' (Choose the currency the thief will receive when stealing in the database)
            --     percentage = 10, -- number (X/100 percentage you will steal from the bank/company in the database)
            -- },
            Rewards = { -- Random reward list for completing a robbery
                {
                    Currency = {    -- List of reward currency for stealing or false
                        {
                            label = '$',	-- Notification item label
                            currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                            amount = 110,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        },
                        -- {
                        --     label = 'Example',	-- Notification item label
                        --     currency = 2,	-- 0 = money, 1 = gold, 2 = rol
                        --     amount = 1,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        -- },
                    },
                    Items = {   -- List of reward items for stealing or false
                        { label = 'Iron ', item = 'iron', amount = 5 },
                        -- { label = 'Example', item = 'example', amount = 5 },
                    },
                },
                -- {
                --     Currency = {    -- List of reward currency for stealing or false
                --         {
                --             label = '$',	-- Notification item label
                --             currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                --             amount = 100,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                --         },
                --     },
                --     Items = {   -- List of reward items for stealing or false
                --         { label = 'Iron ', item = 'iron', amount = 5 },
                --         -- { label = 'Example', item = 'example', amount = 5 },
                --     },
                -- },
            },
        },
        NPCs = {    -- List of enemies when stealing or false / combats NPCS ('sniper', 'horse', 'wagongatlin' or false)
            -- { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2627.4, -1273.68, 56.82, 223.12), weapon = 'WEAPON_REPEATER_WINCHESTER', blip = true, combat = false },
        },
    },
    {
        name = 'Bank of Rhodes', --  Location name is use in the alerts and the robbery prompt
        FloorMarkColor = { r = 0, g = 128, b = 0, alpha = 50, radius = 1 }, -- Floor mark and location range
        coords = vector3(1287.28, -1314.27, 76.04), -- vector3 (Robbery coordinates)
        Notify = 'Several individuals have been seen robbing the Rhodes bank with explosives',  -- Text used in notifications for the Notify and NotifyJobs functions in framework/server.lua
        ExecuteCommand = 'alertpolice Several individuals have been seen robbing the Rhodes bank with explosives', -- text (Command to be executed during the robbery) or false
        SafeMinigame = false,  -- number (number of qadr-safe locks) or false (The thief will use a bomb)
        CollectingTime = 300,   -- (seconds) Time it will take the player to collect the money
        Cooldown = {
            Enable = false,  -- true (Enable cooldown upon completion of a robbery) or false (you will not be able to robbery on completion of a robbery until you restart the server or the script)
            Time = 18000,  -- number (Seconds to start a robbery again, only if 'Enable' is true)
        },
        JobsRequired = {
            OnDuty = false,	-- Get on duty jobs (modifiable function in 'framework/server.lua')
            Amount = 1, -- number (Number of players required with the job from the JobsRequired list to steal)
            Jobs = {    -- job list or false
                'sheriff', 
                'police',
            },
        },
        ItemsRequired = {  -- List of items needed to rob the bank or false
            { label = 'Dynamite', item = 'dynamite', amount = 1 },
            -- { label = 'Example', item = 'example', amount = 5 },
        },
        Robbery = {
            -- DB = {  -- Database theft reward or false
            --     type = 'bank', -- 'bank', 'syn_society', 'mega_companies', 'module_bank', 'dl_society'
            --     name =  'Rhodes', -- Name in the database of the bank/company in the database
            --     amount = 'money', -- 'money', 'gold', or 'both' (Choose the currency the thief will receive when stealing in the database)
            --     percentage = 10, -- number (X/100 percentage you will steal from the bank/company in the database)
            -- },
            Rewards = { -- Random reward list for completing a robbery
                {
                    Currency = {    -- List of reward currency for stealing or false
                        {
                            label = '$',	-- Notification item label
                            currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                            amount = { 1, 5 },	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        },
                        -- {
                        --     label = 'Example',	-- Notification item label
                        --     currency = 2,	-- 0 = money, 1 = gold, 2 = rol
                        --     amount = 1,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        -- },
                    },
                    Items = {   -- List of reward items for stealing or false
                        { label = 'Iron ', item = 'iron', amount = { 6, 9 } },
                        -- { label = 'Example', item = 'example', amount = 5 },
                    },
                },
                -- {
                --     Currency = {    -- List of reward currency for stealing or false
                --         {
                --             label = '$',	-- Notification item label
                --             currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                --             amount = 100,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                --         },
                --     },
                --     Items = {   -- List of reward items for stealing or false
                --         { label = 'Iron ', item = 'iron', amount = 5 },
                --         -- { label = 'Example', item = 'example', amount = 5 },
                --     },
                -- },
            },
        },
        NPCs = {    -- List of enemies when stealing or false / combats NPCS ('sniper', 'horse', 'wagongatlin' or false)
            -- { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2627.4, -1273.68, 56.82, 223.12), weapon = 'WEAPON_REPEATER_WINCHESTER', blip = true, combat = false },
            { model = 'mp_g_m_m_uniinbred_01', coords = vector4(1408.22, -1309.51, 76.65, 112.32), weapon = 'WEAPON_SHOTGUN_PUMP', blip = false, combat = 'wagongatlin' },
            { model = 'mp_g_m_m_uniinbred_01', coords = vector4(1392.51, -1408.22, 78.28, 44.41), weapon = 'WEAPON_SHOTGUN_PUMP', blip = false, combat = 'wagongatlin' },
        },
    },
    {
        name = 'Bank of Valentine', --  Location name is use in the alerts and the robbery prompt
        FloorMarkColor = { r = 0, g = 128, b = 0, alpha = 50, radius = 1 }, -- Floor mark and location range
        coords = vector3(-308.05, 764.13, 117.7), -- vector3 (Robbery coordinates)
        Notify = 'Several individuals have been seen robbing the Valentine bank with explosives',  -- Text used in notifications for the Notify and NotifyJobs functions in framework/server.lua
        ExecuteCommand = 'alertpolice Several individuals have been seen robbing the Valentine bank with explosives', -- text (Command to be executed during the robbery) or false
        SafeMinigame = false,  -- number (number of qadr-safe locks) or false (The thief will use a bomb)
        CollectingTime = 300,   -- (seconds) Time it will take the player to collect the money
        Cooldown = {
            Enable = false,  -- true (Enable cooldown upon completion of a robbery) or false (you will not be able to robbery on completion of a robbery until you restart the server or the script)
            Time = 18000,  -- number (Seconds to start a robbery again, only if 'Enable' is true)
        },
        JobsRequired = {
            OnDuty = false,	-- Get on duty jobs (modifiable function in 'framework/server.lua')
            Amount = 1, -- number (Number of players required with the job from the JobsRequired list to steal)
            Jobs = {    -- job list or false
                'sheriff', 
                'police',
            },
        },
        ItemsRequired = {  -- List of items needed to rob the bank or false
            { label = 'Dynamite', item = 'dynamite', amount = 1 },
            -- { label = 'Example', item = 'example', amount = 5 },
        },
        Robbery = {
            DB = {  -- Database theft reward or false
                type = 'bank', -- 'bank', 'syn_society', 'mega_companies', 'module_bank', 'dl_society'
                name =  'Valentine', -- Name in the database of the bank/company in the database
                amount = 'money', -- 'money', 'gold', or 'both' (Choose the currency the thief will receive when stealing in the database)
                percentage = 10, -- number (X/100 percentage you will steal from the bank/company in the database)
            },
            Rewards = { -- Random reward list for completing a robbery
                {
                    Currency = {    -- List of reward currency for stealing or false
                        {
                            label = '$',	-- Notification item label
                            currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                            amount = { 1, 5 },	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        },
                        -- {
                        --     label = 'Example',	-- Notification item label
                        --     currency = 2,	-- 0 = money, 1 = gold, 2 = rol
                        --     amount = 1,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        -- },
                    },
                    Items = {   -- List of reward items for stealing or false
                        { label = 'Iron ', item = 'iron', amount = { 6, 9 } },
                        -- { label = 'Example', item = 'example', amount = 5 },
                    },
                },
                -- {
                --     Currency = {    -- List of reward currency for stealing or false
                --         {
                --             label = '$',	-- Notification item label
                --             currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                --             amount = 100,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                --         },
                --     },
                --     Items = {   -- List of reward items for stealing or false
                --         { label = 'Iron ', item = 'iron', amount = 5 },
                --         -- { label = 'Example', item = 'example', amount = 5 },
                --     },
                -- },
            },
        },
        NPCs = {    -- List of enemies when stealing or false / combats NPCS ('sniper', 'horse', 'wagongatlin' or false)
            -- { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2627.4, -1273.68, 56.82, 223.12), weapon = 'WEAPON_REPEATER_WINCHESTER', blip = true, combat = false },
        },
    },
    {
        name = 'Police safe', --  Location name is use in the alerts and the robbery prompt
        FloorMarkColor = { r = 0, g = 128, b = 0, alpha = 50, radius = 1 }, -- Floor mark and location range
        coords = vector3(-761.65, -1272.57, 43.05), -- vector3 (Robbery coordinates)
        Notify = 'Several individuals have been seen robbing the police safe in Rhodes',  -- Text used in notifications for the Notify and NotifyJobs functions in framework/server.lua
        ExecuteCommand = 'alertpolice Several individuals have been seen robbing the police safe in Rhodes', -- text (Command to be executed during the robbery) or false
        SafeMinigame = 5,  -- number (number of qadr-safe locks) or false (The thief will use a bomb)
        CollectingTime = 300,   -- (seconds) Time it will take the player to collect the money
        Cooldown = {
            Enable = false,  -- true (Enable cooldown upon completion of a robbery) or false (you will not be able to robbery on completion of a robbery until you restart the server or the script)
            Time = 18000,  -- number (Seconds to start a robbery again, only if 'Enable' is true)
        },
        JobsRequired = {
            OnDuty = false,	-- Get on duty jobs (modifiable function in 'framework/server.lua')
            Amount = 1, -- number (Number of players required with the job from the JobsRequired list to steal)
            Jobs = {    -- job list or false
                'sheriff', 
                'police',
            },
        },
        ItemsRequired = {  -- List of items needed to rob the bank or false
            { label = 'Dynamite', item = 'dynamite', amount = 1 },
            -- { label = 'Example', item = 'example', amount = 5 },
        },
        Robbery = {
            DB = {  -- Database theft reward or false
                type = 'bank', -- 'bank', 'syn_society', 'mega_companies', 'module_bank', 'dl_society'
                name =  'police', -- Name in the database of the bank/company in the database
                amount = 'money', -- 'money', 'gold', or 'both' (Choose the currency the thief will receive when stealing in the database)
                percentage = 10, -- number (X/100 percentage you will steal from the bank/company in the database)
            },
            Rewards = { -- Random reward list for completing a robbery
                {
                    Currency = {    -- List of reward currency for stealing or false
                        {
                            label = '$',	-- Notification item label
                            currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                            amount = { 1, 5 },	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        },
                        -- {
                        --     label = 'Example',	-- Notification item label
                        --     currency = 2,	-- 0 = money, 1 = gold, 2 = rol
                        --     amount = 1,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                        -- },
                    },
                    Items = {   -- List of reward items for stealing or false
                        { label = 'Iron ', item = 'iron', amount = { 6, 9 } },
                        -- { label = 'Example', item = 'example', amount = 5 },
                    },
                },
                -- {
                --     Currency = {    -- List of reward currency for stealing or false
                --         {
                --             label = '$',	-- Notification item label
                --             currency = 0,	-- 0 = money, 1 = gold, 2 = rol
                --             amount = 100,	-- number (Amount of money that the player will receive) or { min, max } (Minimum and maximum random number in a list)
                --         },
                --     },
                --     Items = {   -- List of reward items for stealing or false
                --         { label = 'Iron ', item = 'iron', amount = 5 },
                --         -- { label = 'Example', item = 'example', amount = 5 },
                --     },
                -- },
            },
        },
        NPCs = {    -- List of enemies when stealing or false / combat = ('sniper', 'horse', 'wagongatlin' or false)
            -- { model = 'S_M_M_AmbientSDPolice_01', coords = vector4(2627.4, -1273.68, 56.82, 223.12), weapon = 'WEAPON_REPEATER_WINCHESTER', blip = true, combat = false },
        },
    },
}


```

{% endcode %}

</details>

<details open>

<summary>framework</summary>

client.lua

{% code expandable="true" %}

```lua
TriggerEvent("getCore", function(core)
    VORPcore = core
end)

function NotifyObjective(title, time)
    VORPcore.NotifyObjective(title, time)
end
```

{% endcode %}

server.lua

{% code expandable="true" %}

```lua
TriggerEvent("getCore", function(core)
    VORPcore = core
end)

local VORPInv = exports.vorp_inventory:vorp_inventoryApi()

function NotifyLeft(source, title, subtitle, dict, icon , time, color)
    VORPcore.NotifyLeft(source, title, subtitle, dict, icon , time, color)
end

function NotifyAvanced(source, title, dict, icon, color, time)
    VORPcore.NotifyAvanced(source, title, dict, icon, color, time)
end

function NotifyObjective(source, text, time)
    VORPcore.NotifyObjective(source, text, time)
end

function GetCharacter(source)
    -- .identifier
    -- .job
    -- .firstname
    -- .lastname
    return VORPcore.getUser(source).getUsedCharacter
end

function GetCharacterJob(source)
    return Player(source).state.Character and Player(source).state.Character.Job 
end

function addCurrency(source, currency, amount)
    -- currency: 0 money, 1 gold
    local Character = GetCharacter(source)
    Character.addCurrency(currency, amount)
end

function getItemCount(source, item, metadata)
    return VORPInv.getItemCount(source, item, metadata)
end

function subItem(source, item, amount)
    return VORPInv.subItem(source, item, amount)
end

function addItem(source, item, amount, metadata)
    return VORPInv.addItem(source, item, amount, metadata)
end

function AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
    VORPcore.AddWebhook(title, webhook, description, color, name, logo, footerlogo, avatar)
end

function OnDuty(job)
    local players = exports["syn_society"]:GetPlayersOnDuty(job)
    return #players    -- number
end

function Notify(Text) -- Notification that will only be executed 1 time
    -- TriggerEvent('ExampleNotify')
end

function NotifyJobs(source, Text) -- Individual notification to players who have the required job
    TriggerClientEvent("chatMessage", source, '[ALERTPOLICE]', {255, 255, 255}, Text)
    NotifyObjective(source, Text, 10000)
    -- TriggerClientEvent('ExampleNotify', source)
end

SQLTables = {
    ['bank'] = {
        Table = 'bank_users',
        Columns = {
            Id = 'name',    -- Column dbname
            Money = 'money',
            Gold = 'gold',
        },
    },
    ['module_bank'] = {
        Table = 'module_banks',
        Columns = {
            Id = 'location',    -- Column dbname
            Money = 'account',
            Gold = 'golds',
        },
    },
    ['syn_society'] = {
        Table = 'society_ledger',
        Columns = {
            Id = 'job', -- Column dbname
            Money = 'ledger',
            Gold = false,
        },
    },
    ['mega_companies'] = {
        Table = 'company',
        Columns = {
            Id = 'name',    -- Column dbname
            Money = 'wallet',
            Gold = false,
        },
    },
    ['dl_society'] = {
        Table = 'dl_jobs',
        Columns = {
            Id = 'name',    -- Column dbname
            Money = 'balance',
            Gold = false,
        },
    },
}
```

{% endcode %}

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xakra-scripts.gitbook.io/xakra-scripts-docs/redm-docs/xakra_bankrobbery.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
