Page cover

Accessible files

Here you can find all the files which can be edite to make the asset compatible with your server.​

config.lua
----------------------------------------------------------------------------------------------
-------------------------------------| BRUTAL GANGS :) |--------------------------------------
----------------------------------------------------------------------------------------------

--[[
Hi, thank you for buying our script, We are very grateful!

For help join our Discord server:     https://discord.gg/85u2u5c8q9
More informations about the script:   https://docs.brutalscripts.com
--]]

Config = {
    Core = 'ESX',  -- 'ESX' / 'QBCORE' | Other core setting on the 'core' folder.
    Inventory = 'ox_inventory', -- 'ox_inventory' / 'qb_inventory' / 'quasar_inventory' / 'chezza_inventory' / 'codem_inventory' / 'core_inventory' / 'origen_inventory' / 'ps-inventory' / 'tgiann-inventory' // Custom can be add in the cl_utils.lua!!!
    Wardrobe = 'default', -- 'default' / 'ak47_clothing' / 'codem_apperance' / 'fivem_appearance' / 'illenium_appearance' / 'qb_clothing' / 'raid_clothes' / 'rcore_clothes' / 'rcore_clothing' / 'sleek_clothestore' / 'tgiann_clothing' // Custom can be add in the cl_utils.lua!!!
    TextUI = 'brutal_textui', -- false / 'brutal_textui' / 'ox_lib' / 'okokTextUI' / 'ESXTextUI' / 'QBDrawText' // Custom can be add in the cl_utils.lua!!!
    Target = '', -- 'oxtarget' / 'qb-target' // if the TextUI is set to false target will step its place. | The Target cannot be false.
    BrutalNotify = true, -- Buy here: (4€+VAT) https://store.brutalscripts.com | Or set up your own notify >> cl_utils.lua
    BrutalKeys = true, -- Buy here: (15€+VAT) https://store.brutalscripts.com | Or set up your own if you're using a different vehicle key >> cl_utils.lua
    SteamName = true, -- true = Steam name | false = character name
    DateFormat = '%d/%m/%Y', -- Date format

    SaveLastGang = false, -- true / false || If true, it saves the player's last gang, and when they set their job back to that gang, they will regain their previous rank. (This will only work if they set their job back from a non gang job like a taxi job.)
    SetJobAfterCreate = true, -- true / false || if true, it sets the player's job/gang to the one created.
    NoneJob = {esx = "unemployed", qb = "none"},
    LockPick = {resourcename = "lockpick"}, -- You can change the name of the lockpick script if you're using one of the scripts with this name.
    EnableCayoPericoMap = false, -- If your server has the "cayo perico" dlc, turn this to "true" and you will see the island in the gangmenu map.

    HQBlip = {use = true, sprite = 40, color = 32, size = 0.8},
    Marker = {marker = 20, bobUpAndDown = true, rotate = false, size = {0.3, 0.2, 0.2}, rgb = {15, 100, 210}},

    Commands = {
        GangMenu = {
            Command = 'gangmenu', 
            Suggestion = 'To open the gang menu',
            Control = '',  -- Controls list:  https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
        },

        GetGangVehicleBack = {
            Command = 'getgangvehicleback', --  /getgangvehicleback all | /getgangvehicleback DHR 432
            Suggestion = 'To get back your vehicle(s)'
        },

        CreateGraffiti = {
            Command = 'graffiti',
            Suggestion = 'To create a new graffiti',
            Item = "spraycan"
        },

        CleanGraffiti = {
            Command = 'cleangraffiti',
            Suggestion = 'To clean a graffiti',
            Item = "sprayremover"
        },

        -- Admin commands

        EditGangs = {
            AdminGroups = {'superadmin', 'admin', 'mod', 'god'},
            Command = 'editgangs', 
            Suggestion = 'To edit the gangs'
        },

        SetGangLeader = {
            AdminGroups = {'superadmin', 'admin', 'mod', 'god'},
            Command = 'setgangleader', 
            Suggestion = 'To set up the gang leader'
        },
    },

    Levels = {
        [0] = {
            maxMembersCount = 6,

            vehicles = {amount = 6, price = nil},
            stash = {size = 100, price = nil},
            ranks = {amount = 3, price = nil},
            raid = {available = false, price = nil},
        },

        [1] = {
            price = {money = 50000, rep = 3750},
            maxMembersCount = 12,

            vehicles = {amount = 18, price = {money = 15000, rep = 525}},
            stash = {size = 200, price = {money = 5000, rep = 175}},
            safe = {available = true, size = 20, price = {money = 25000, rep = 875}},
            ranks = {amount = 6, price = {money = 0, rep = 650}},
            raid = {available = false, price = nil},
        },

        [2] = {
            price = {money = 150000, rep = 11250},
            maxMembersCount = 18,

            vehicles = {amount = 30, price = {money = 15000, rep = 525}},
            stash = {size = 300, price = {money = 5000, rep = 175}},
            safe = {available = true, size = 30, price = {money = 3000, rep = 105}},
            ranks = {amount = 9, price = {money = 0, rep = 650}},
            raid = {available = true, price = {money = 25000, rep = 875}},
        },

        [3] = {
            price = {money = 250000, rep = 18750},
            maxMembersCount = 24,

            vehicles = {amount = 48, price = {money = 15000, rep = 525}},
            stash = {size = 400, price = {money = 5000, rep = 175}},
            safe = {available = true, size = 40, price = {money = 3000, rep = 105}},
            ranks = {amount = 12, price = {money = 0, rep = 650}},
            raid = {available = true, price = {money = 25000, rep = 875}},
        },
    },

    HQS = {
        ["ballas"] = {
            MapPosition = {
                vector2(-36.8547, -1753.4171),
                vector2(-61.3669, -1785.3739),
                vector2(-21.2381, -1821.4756),
                vector2(-50.6818, -1858.8644),
                vector2(29.3174, -1930.7737),
                vector2(86.4986, -1860.3062),
            },

            MiddlePoint = vector3(7.7007, -1816.5464, 25.3697),
            HQCanBeCaptured = true,

            DefaultCoords = {
                Cloakrooms = {
                    vector3(0.7138, -1819.6553, 29.1527),
                },
    
                Stashes = {
                    vector3(2.5605, -1817.7943, 29.1526),
                },

                BalanceManages = {
                    vector3(-0.4499, -1809.0541, 29.1527),
                },

                Garages = {
                    {
                        open = vector3(11.8271, -1817.3561, 25.2843),
                        spawn = vector4(13.5363, -1820.2806, 24.7847, 143.9035)
                    },
                },
            },
        },

        ["triads"] = {
            MapPosition = {
                vector2(-641.1872, -1268.0148),
                vector2(-568.8250, -1197.5732),
                vector2(-548.0913, -1102.7590),
                vector2(-552.4677, -966.7898),
                vector2(-624.6595, -969.4564),
                vector2(-636.4352, -1035.5703),
                vector2(-666.9618, -1072.7643),
                vector2(-749.0092, -1121.3713),
            },

            MiddlePoint = vector3(-641.7220, -1234.5129, 11.5514),
            HQCanBeCaptured = true,

            DefaultCoords = {
                Cloakrooms = {
                    vector3(-648.8576, -1229.3621, 11.5516),
                },
    
                Stashes = {
                    vector3(-652.6179, -1230.2782, 11.5516),
                },

                BalanceManages = {
                    vector3(-644.4189, -1244.2264, 11.5516),
                },

                Garages = {
                    {
                        open = vector3(-645.2076, -1221.4576, 11.0470),
                        spawn = vector4(-644.1460, -1217.9924, 10.8716, 303.2067)
                    },
                },
            },
        },

        ["vagos"] = {
            MapPosition = {
                vector2(326.2715, -2140.4065),
                vector2(248.8809, -2071.6580),
                vector2(355.7063, -1947.0470),
                vector2(427.0373, -2020.0443),
            },

            MiddlePoint = vector3(338.9244, -2042.7440, 21.2988),
            HQCanBeCaptured = true,

            DefaultCoords = {
                Cloakrooms = {
                    vector3(325.5719, -1999.3409, 24.2077),
                },
    
                Stashes = {
                    vector3(329.4389, -1998.6117, 24.2077),
                },

                BalanceManages = {
                    vector3(338.2400, -1979.8922, 24.2078),
                },

                Garages = {
                    {
                        open = vector3(323.1876, -2017.5780, 21.2353),
                        spawn = vector4(321.0982, -2021.5391, 20.3820, 141.2121)
                    },
                },
            },
        },

        ["lostmc"] = {
            MapPosition = {
                vector2(931.9505, -122.5973),
                vector2(986.2697, -156.0796),
                vector2(1022.2856, -119.8539),
                vector2(980.7446, -76.5461),
            },

            MiddlePoint = vector3(969.5955, -126.4073, 74.3605),
            HQCanBeCaptured = true,

            DefaultCoords = {
                Cloakrooms = {
                    vector3(971.9257, -98.7307, 74.8464),
                },
    
                Stashes = {
                    vector3(986.6417, -92.7903, 74.8459),
                },

                BalanceManages = {
                    vector3(976.9885, -103.8749, 74.8452),
                },

                Garages = {
                    {
                        open = vector3(960.9912, -123.2064, 74.3532),
                        spawn = vector4(961.9102, -125.5999, 74.0335, 134.2543)
                    },
                },
            },
        },

        ["families"] = {
            MapPosition = {
                vector2(-181.5696, -1765.1079),
                vector2(-49.3258, -1607.2705),
                vector2(-252.9951, -1444.2129),
                vector2(-274.8223, -1535.6073),
                vector2(-340.4381, -1653.6207),
                vector2(-252.6444, -1706.5421),
            },
            
            MiddlePoint = vector3(-194.6743, -1606.9457, 34.0031),
            HQCanBeCaptured = true,

            DefaultCoords = {
                Cloakrooms = {
                    vector3(-162.5451, -1612.9545, 33.6494),
                },
    
                Stashes = {
                    vector3(-164.0853, -1607.2548, 33.6494),
                },

                BalanceManages = {
                    vector3(-163.7477, -1619.0095, 33.6494),
                },

                Garages = {
                    {
                        open = vector3(-142.5249, -1631.2947, 32.9337),
                        spawn = vector4(-138.1050, -1634.1799, 31.8673, 321.9159)
                    },
                },
            },
        },

        ["angels"] = {
            MapPosition = {
                vector2(1186.1561, -1819.9590),
                vector2(1401.5608, -1750.3341),
                vector2(1377.2861, -1690.7479),
                vector2(1275.9623, -1539.6001),
                vector2(1175.1179, -1611.6343),
                vector2(1112.2068, -1621.6501),
            },
            
            MiddlePoint = vector3(1252.8992, -1676.1508, 44.0245),
            HQCanBeCaptured = true,

            DefaultCoords = {
                Cloakrooms = {
                    vector3(1272.4738, -1714.6812, 54.7714),
                },
    
                Stashes = {
                    vector3(1268.7084, -1710.2638, 54.7714),
                },

                BalanceManages = {
                    vector3(1275.4862, -1710.6750, 54.7714),
                },

                Garages = {
                    {
                        open = vector3(1286.8423, -1726.0486, 53.0865),
                        spawn = vector4(1287.5776, -1728.0398, 52.8059, 114.7845)
                    },
                },
            },
        },
    },

    Scout = {
        MaximumTime = 15, -- in minutes
        MinimumOnlineMembers = 1, -- minimum members online to start
    },

    Raid = {
        Price = {money = 15000, rep = 1750},
        MaximumTime = 30, -- in minutes
        MinimumOnlineMembers = 1, -- minimum members online to start
        CooldownAfterDeath = 10, -- in minutes
        WinReward = {use = true, money = 15000, rep = 1750}, -- The reward given to the attacking gang if they win the raid.
        LossReward = {use = true, money = 300, rep = 750}, -- The reward given to the defending gang if they lose the defense.
        StashLooting = {use = true, time = 5}, -- use: true / false | time = 1 = 1min
        Limit = 72, -- in hours
        TimeZoneLimit = { -- Gangs can only raid each other between the set time range {'starting time', 'ending time'} | If you don't set anything they can raid at any time of the day if the other conditions are right.
            -- {"18:00", "20:00"},
            -- {"12:00", "14:00"},
        },
    },

    Graffiti = {
        Use = true, -- You can disable the whole graffiti placing / cleaning part of our script if you set this to false.
        ShowDistance = 100.0,

        MinDistances = 10.0,
        MaxGraffitiPerGang = 25,

        LimitPerMember = 10, -- in minutes
        CleanLimitPerMember = 10, -- in minutes

        SmartPlacing = false, -- true / false

        PlaceReputation = 50,
        CleanReputation = 25,

        DisableControls = {24,257,25,263,32,34,31,30,45,22,44,37,23,288,289,170,167,73,199,59,71,72,36,47,264,257,140,141,142,143,75}, -- Disabled controls

        CleanGraffitiNotifyAlert = true,
        CleanGraffitiBlipAlert = {use = true, sprite = 161, color = 2, size = 0.8, time = 1}, -- use: true / false | time: 1 = 1min

        BlacklistedZones = {
            {coords = vector3(455.81, -997.04, 43.69), radius = 200.0}, -- Police
            {coords = vector3(324.76, -585.72, 59.15), radius = 100.0}, -- Hospital
            {coords = vector3(-376.73, -119.47, 40.73), radius = 100.0}, -- Mechanic
        },

        Icons = {
            {name = "None", prop = "", png = "None.png"}, -- this is the basic one, do not edit it.
            {name = "Vagos", prop = "sprays_vagos", png = "Vagos.png"},
            {name = "The Mandnem", prop = "sprays_mandem", png = "The_Mandnem.png"},
            {name = "The Guild", prop = "sprays_guild", png = "The_Guild.png"},
            {name = "Street Team", prop = "sprays_st", png = "Street_Team.png"},
            {name = "Seaside", prop = "sprays_seaside", png = "Seaside.png"},
            {name = "SCU", prop = "sprays_scu", png = "SCU.png"},
            {name = "Rust", prop = "sprays_rust", png = "Rust.png"},
            {name = "Ron", prop = "sprays_ron", png = "Ron.png"},
            {name = "Ramee", prop = "sprays_ramee", png = "Ramee.png"},
            {name = "NBC", prop = "sprays_nbc", png = "NBC.png"},
            {name = "Mayhem", prop = "sprays_mayhem", png = "Mayhem.png"},
            {name = "Lost MC", prop = "sprays_lost", png = "Lost_MC.png"},
            {name = "Kingz", prop = "sprays_kingz", png = "Kingz.png"},
            {name = "Hydra", prop = "sprays_hydra", png = "Hydra.png"},
            {name = "Hoa", prop = "sprays_hoa", png = "Hoa.png"},
            {name = "Gulag Gang", prop = "sprays_gg", png = "Gulag_Gang.png"},
            {name = "GSF", prop = "sprays_gsf", png = "GSF.png"},
            {name = "Chang Gang", prop = "sprays_cg", png = "Chang_Gang.png"},
            {name = "Cerberus", prop = "sprays_cerberus", png = "Cerberus.png"},
            {name = "BSK", prop = "sprays_bsk", png = "BSK.png"},
            {name = "Bondi Boys MC", prop = "sprays_bcf", png = "Bondi_Boys_Mc.png"},
            {name = "BCF", prop = "sprays_bcf", png = "BCF.png"},
            {name = "Ballas", prop = "sprays_ballas", png = "Ballas.png"},
            {name = "Angels", prop = "sprays_angels", png = "Angels.png"},
        },
    },

    Tasks = {
        ["drug"] = {
            Label = "NARCOTICS HEIST",
            Description = "In the Narcotics Heist, steal a drug shipment from a cartel and sell it before they catch you.",
            TimeToCompletion = 20, -- in minutes
            TimeToRestart = 1440, -- in minutes
            Reward = {
                money = {min = 5000, max = 20000}, 
                rep = {min = 250, max = 1000},
                items = { -- First value is the item name, second value is the amount
                    --{'cocaine', 1}, 
                },
            },

            VanPosition = {
                {
                    Van = vector4(-463.3471, -63.0104, 44.2518, 218.4606),
                    Guards = {
                        {model = "g_m_y_korean_02", coords = vector4(-459.7697, -62.7800, 44.5134, 42.0405), weapon = "WEAPON_ASSAULTRIFLE"},
                        {model = "g_m_y_korean_01", coords = vector4(-468.8365, -62.5431, 44.5134, 345.1089), weapon = "WEAPON_ASSAULTRIFLE"},
                        {model = "g_m_y_mexgoon_03", coords = vector4(-459.6652, -56.9242, 44.5134, 75.7623), weapon = "WEAPON_ASSAULTRIFLE"},
                    },
                },

                {
                    Van = vector4(155.0316, -1233.0797, 28.9633, 254.9915),
                    Guards = {
                        {model = "g_m_y_korean_02", coords = vector4(149.0482, -1230.9833, 29.1985, 223.3919), weapon = "WEAPON_ASSAULTRIFLE"},
                        {model = "g_m_y_korean_01", coords = vector4(147.3018, -1232.9353, 29.1985, 250.9159), weapon = "WEAPON_ASSAULTRIFLE"},
                        {model = "g_m_y_mexgoon_03", coords = vector4(146.1674, -1235.1293, 29.1985, 255.9488), weapon = "WEAPON_ASSAULTRIFLE"},
                    },
                },
            },
            EndingPoint = {
                {
                    MainCoords = vector3(1162.4951, -1496.4705, 34.4312), 
                    CustomersVehicle = vector4(1158.1821, -1490.3347, 34.4314, 2.1476),
                    Customers = {
                        {model = "g_m_y_mexgoon_03", coords = vector4(1156.4387, -1493.8158, 33.6925, 239.6427)},
                        {model = "g_m_y_mexgang_01", coords = vector4(1159.7421, -1493.9291, 33.6925, 142.1639)},
                    },
                },

                {
                    MainCoords = vector3(676.3511, -2648.5149, 5.8198), 
                    CustomersVehicle = vector4(668.6371, -2655.3589, 5.8093, 152.9441),
                    Customers = {
                        {model = "g_m_y_mexgoon_03", coords = vector4(671.9014, -2653.2356, 5.0812, 15.0290)},
                        {model = "g_m_y_mexgang_01", coords = vector4(668.8821, -2651.4241, 5.0812, 286.6457)},
                    },
                },
            }
        },

        ["disposalofthebody"] = {
            Label = "BODY DISPOSAL",
            Description = "You must discreetly get rid of evidence by disposing of a body without leaving any trace for law enforcement.",
            TimeToCompletion = 20, -- in minutes
            TimeToRestart = 1440, -- in minutes
            Reward = {
                money = {min = 10000, max = 15000}, 
                rep = {min = 500, max = 800},
                items = { -- First value is the item name, second value is the amount
                    --{'cocaine', 1}, 
                },
            },

            VanPosition = {
                {coords = vector4(679.8264, 68.4786, 83.2498, 182.2196)},
            },
            DeadBodyPosition = {
                {coords = vector3(-1077.0720, 712.9972, 163.4137), heading = 127.0},
            },
            EndingPoint = {
                {
                    MainCoords = vector3(67.0433, -2755.7847, 6.0046), 
                    Boat = {model = 'tropic', coords = vector4(8.6673, -2797.2100, 0.2756, 181.5510)},
                    ThrowPoint = vector3(-250.7096, -4219.0371, -3.2772),
                },
            }
        },

        ["homeless"] = {
            Label = "HOMELESS KIDNAPPING",
            Description = "You must abduct a target from the streets without drawing attention from bystanders or authorities.",
            TimeToCompletion = 20, -- in minutes
            TimeToRestart = 1440, -- in minutes
            Reward = {
                money = {min = 6000, max = 12000}, 
                rep = {min = 450, max = 1350},
                items = { -- First value is the item name, second value is the amount
                    --{'cocaine', 1}, 
                },
            },

            HomelessPedPosition = {
                {coords = vector3(18.5995, -1228.6848, 28.4795), heading = 280.0},
                {coords = vector3(357.6796, -835.1513, 28.2916), heading = 176.0},
                {coords = vector3(-517.6873, -865.7912, 28.5060), heading = 280.0},
            },
            EndingPoint = {
                {
                    MainCoords = vector3(1377.6155, -747.5517, 66.47), 
                    CustomersVehicle = {model = 'dubsta2', coords = vector4(1386.2517, -742.9697, 67.2858, 339.2372)},
                    Customers = {
                        {model = "g_m_y_mexgang_01", coords = vector4(1387.3867, -745.9840, 66.1903, 90.7682)},
                        {model = "g_m_y_mexgoon_03", coords = vector4(1383.4774, -744.2767, 66.1852, 151.0328)},
                    },
                },

                {
                    MainCoords = vector3(-1157.2125, -1454.5078, 3.4823), 
                    CustomersVehicle = {model = 'dubsta2', coords = vector4(-1155.9701, -1462.3113, 4.3237, 125.4273)},
                    Customers = {
                        {model = "g_m_y_mexgoon_03", coords = vector4(-1151.7054, -1462.2007, 3.4187, 20.5159)},
                        {model = "g_m_y_mexgang_01", coords = vector4(-1156.8384, -1460.3912, 3.3861, 311.5188)},
                    },
                },
            }
        },

        ["assassination"] = {
            Label = "ASSASSINATION CONTRACT",
            Description = "You must eliminate a high-value target quickly and discreetly, leaving no witnesses behind.",
            TimeToCompletion = 20, -- in minutes
            TimeToRestart = 1440, -- in minutes
            Reward = {
                money = {min = 7500, max = 30000}, 
                rep = {min = 250, max = 1150},
                items = { -- First value is the item name, second value is the amount
                    --{'cocaine', 1}, 
                },
            },

            TargetPedPosition = {
                {startcoords = vector3(-332.3789, -672.7446, 32.3814), finishcoords = vector3(304.8678, -740.3984, 29.3166)},
                {startcoords = vector3(553.8753, 152.7980, 99.2896), finishcoords = vector3(-239.1566, 244.2611, 92.0406)},
                {startcoords = vector3(-1274.0237, 315.4701, 65.5117), finishcoords = vector3(-1392.7247, -299.2366, 43.6122)},
            },
            EndingPoint = {
                {
                    MainCoords = vector3(265.9774, 3178.4739, 41.6437), 
                    Customers = {
                        {model = "g_m_y_mexgoon_03", coords = vector4(260.6587, 3178.2278, 41.7484, 283.4235)},
                    },
                },
                {
                    MainCoords = vector3(1534.0110, 6328.8813, 23.4418), 
                    Customers = {
                        {model = "g_m_y_mexgoon_03", coords = vector4(1538.7380, 6324.4023, 23.0684, 37.5559)},
                    },
                },
            }
        },
    },

    ExternalTasks = {
        /*["external_1"] = {
            Label = "EXAMPLE TASK",
            Description = "You must eliminate a high-value target quickly and discreetly, leaving no witnesses behind.",
            TimeToRestart = 1440, -- in minutes
            event = 'brutal_gangs:client:utils:StartExternalTask', -- Put here any client sided event which starts a robbery or a heist
        },*/
    },
   
    -----------------------------------------------------------
    -----------------------| TRANSLATE |-----------------------
    -----------------------------------------------------------

    MoneyForm = '$', -- Money form

    Locales = {
        CurrencyForm = "USD",
        ReputationForm = "REP",

        DefaultGradeName = "Member",

        Cloakrooms = "Cloakroom",
        Stashes = "Stash",
        BalanceManages = "Balance Manage",
        Garages = "Garage",
        Safe = "Safe",
        
        MemberRankName = "Member",
        LeaderRankName = "Leader",

        CoordsEditingText = "~y~Press ~INPUT_CELLPHONE_SELECT~ to set the new coords.~w~\nPress ~INPUT_CELLPHONE_CANCEL~ to ~r~cancel~w~ the process.",
        GraffitiPlacingText = "~y~Press ~INPUT_CELLPHONE_SELECT~ to create the graffiti.~w~\n~g~Scroll ~INPUT_WEAPON_WHEEL_NEXT~ ~w~ to change size.\nPress ~INPUT_CELLPHONE_CANCEL~ to ~r~cancel~w~ the process.",

        TaskStart = "Task Start",

        Blips = {
            HQ = "HQ",

            Safe = "Safe",
            Vehicle = "Vehicle",
            House = "House",
            Port = "Port",
            Boat = "Boat",
            Drop = "Drop",
            Company = "Company",
            DrugSelling = "Drug Selling",
            Money = "Get Money",
            Homeless = "Homeless",
            MeetingPoint = "Meeting point",
            Target = "Target",
        }
    },

    Texts = {
        [1] = {'[E] - Dress Menu', 38, 'Open the dress menu', 'fa-solid fa-person-half-dress'},
        [2] = {'[E] - Stash Menu', 38, 'Open the stash menu', 'fa-solid fa-box-open'}, 
        [3] = {'[E] - Garage Menu', 38, 'Open the garage menu', 'fa-solid fa-warehouse'}, 
        [4] = {'[E] - Vehicle storage', 38, 'To storage the vehicle', 'fa-solid fa-car'}, 
        [5] = {'[E] - Safe Menu', 38, 'Open the safe menu', 'fa-solid fa-shield'}, 
        [6] = {'[E] - Balance Manage', 38, 'Open the balance menu', 'fa-solid fa-coins'}, 
        [7] = {'[E] - Continue the task', 38},
        [8] = {'[E] - Start the task', 38},  
    },
    
    -- Notify function EDITABLE >> cl_utils.lua
    Notify = { 
        [1] = {"Gangs", "You're too far!", 5000, "error"},
        [2] = {"Gangs", "The job already exists!", 5000, "error"},
        [3] = {"Gangs", "You don't have permission to do this.", 5000, "error"},
        [4] = {"Gangs", "You've successfully invited a new member!", 5000, "success"},
        [5] = {"Gangs", "You've been successfully added to a gang!", 5000, "success"},
        [6] = {"Gangs", "You've kicked them out of the gang!", 5000, "success"},
        [7] = {"Gangs", "You've been kicked out of the gang!", 5000, "info"},
        [8] = {"Gangs", "Invalid Gang!", 5000, "error"},
        [9] = {"Gangs", "S/he is already a leader!", 5000, "error"},
        [10] = {"Gangs", "You have successfully added a new leader!", 5000, "success"},
        [11] = {"Gangs", "You're a gang leader now!", 5000, "info"},
        [12] = {"Gangs", "Invalid Player ID!", 5000, "error"},
        [13] = {"Gangs", "This rank already exists!", 5000, "error"},
        [14] = {"Gangs", "You've successfully created the new rank!", 5000, "success"},
        [15] = {"Gangs", "You've deleted the selected rank!", 5000, "success"},
        [16] = {"Gangs", "Before deleting make sure that nobody have this rank!", 5000, "error"},
        [17] = {"Gangs", "For example: /setgangleader [id] [job]", 5000, "error"},
        [18] = {"Gangs", "Successfully update!", 5000, "success"},
        [19] = {"Gangs", "There isn't enough money for that!", 5000, "error"},
        [20] = {"Gangs", "You can't turn this vehicle into a gang car because it's not yours!", 7000, "error"},
        [21] = {"Gangs", "The vehicle is not in the garage!", 5000, "error"},
        [22] = {"Gangs", "You've got it back:", 5000, "success"},
        [23] = {"Gangs", "No vehicle to get back!", 5000, "error"},
        [24] = {"Gangs", "Upgrade needed for this action!", 5000, "error"},
        [25] = {"Gangs", "Another vehicle occupies the space!", 5000, "error"},
        [26] = {"Gangs", "S/he is already a member of the group!", 5000, "error"},
        [27] = {"Gangs", "Fill in all the fields!", 5000, "error"},
        [28] = {"Gangs", "You cannot delete it!", 5000, "error"},
        [29] = {"Gangs", "You're too far from the middle of hq!", 5000, "error"},
        [30] = {"Gangs", "This HQ is already in use!", 5000, "error"},
        [31] = {"Gangs", "Invalid HQ! The hq isn't defined in the config!", 5000, "error"},
        [32] = {"Gangs", "Successful pin!", 5000, "success"},
        [33] = {"Gangs", "Your rank has been changed to:", 5000, "info"},
        [34] = {"Gangs", "The rank's name must be between 3-12 characters!", 5000, "error"},
        [35] = {"Gangs", "You have already reached today's limit!", 5000, "error"},
        [36] = {"Gangs", "You've successfully started!", 5000, "success"},
        [37] = {"Gangs", "You cannot start it right now!", 5000, "error"},
        [38] = {"Gangs", "New level of gang:", 5000, "success"},
        [39] = {"Gangs", "There isn't that much money available in the safe!", 5000, "error"},
        [40] = {"Gangs", "You don't have enough money!", 5000, "error"},
        [41] = {"Gangs", "Your gang is under attack!", 5000, "info"},
        [42] = {"Gangs", "You have successfully deleted the job!", 5000, "success"},
        [43] = {"Gangs", "You cannot put graffiti on this place.", 5000, "error"},
        [44] = {"Gangs", "Someone has already put graffiti nearby.", 5000, "error"},
        [45] = {"Gangs", "You have reached maximum graffiti in the team!", 5000, "error"},
        [46] = {"Gangs", "There is no near graffiti!", 5000, "error"},
        [47] = {"Gangs", "You do not have the necessary item!", 5000, "error"},
        [48] = {"Gangs", "You have to get out of the car!", 5000, "error"},
        [49] = {"Gangs", "You have to park your car here!", 5000, "error"},
        [50] = {"Gangs", "You failed!", 5000, "error"},
        [51] = {"Gangs", "For example: /setgangleader [player id]", 5000, "error"},
        [52] = {"Gangs", "No drugs on your hands!", 5000, "error"},
        [53] = {"Gangs", "The gang name and label must be at least 3 characters long!", 5000, "error"},
        [54] = {"Gangs", "You have successfully created the job!", 5000, "success"},
        [55] = {"Gangs", "You have successfully saved it!", 5000, "success"},
        [56] = {"Gangs", "The task has failed!", 5000, "error"},
        [57] = {"Gangs", "There is already a task in progress!", 5000, "error"},
        [58] = {"Gangs", "The selected task is already in use!", 5000, "error"},
        [59] = {"Gangs", "You have successfully completed the task!", 5000, "success"},
        [60] = {"Gangs", "You can only graffiti every 10 minutes! Try again later!", 5000, "error"},
        [61] = {"Gangs", "You can only clean graffiti every 10 minutes!", 5000, "error"},
        [62] = {"Gangs", "They all must die!", 5000, "error"},
        [63] = {"Gangs", "The vehicle must be empty!", 5000, "error"},
        [64] = {"Gangs", "There must be a vehicle near!", 5000, "error"},
        [65] = {"Gangs", "Catch the homeless man!", 5000, "info"},
        [66] = {"Gangs", "Already in progress!", 5000, "error"},
        [67] = {"Gangs", "No spaces in the gang name!", 5000, "error"},
        [68] = {"Gangs", "You are not able to open the menu!", 5000, "error"},
        [69] = {"Gangs", "The player must be a gang member first!", 5000, "error"},
        [70] = {"Gangs", "The gang icon must be selected in the menu!", 5000, "error"},
        [71] = {"Gangs", "Someone cleaned your gang's graffiti! Marked on the map!", 5000, "info"},
    },

    Webhooks = {
        Locale = {
            ['editGangDatas1'] = "⌛ Gang details updated...",
            ['gangCreation1'] = "🆕 New gang has been created...",
            ['gangDeleted1'] = "🆕 Gang has been deleted...",
            ['scout1'] = "🔍 They got the data from another gang...",
            ['raidStart1'] = "⚔️ Raid has started...",
            ['raidEnd1'] = "⚔️ Raid has ended...",

            ['editGangDatas2'] = "edited the gang's data.",
            ['gangCreation2'] = "created a new gang.",
            ['gangDeleted2'] = "deleted a gang.",
            ['scout2'] = "started the scouting...",
            ['raidStart2'] = "started a raid...",

            ['Identifier'] = "Identifier",
            ['GangName'] = "Gang Name",
            ['GangLabel'] = "Gang Label",
            ['Balance'] = "Balance",
            ['Reputation'] = "Reputation Points",
            ['Status'] = "Status 📈",
            ['Enemy'] = "Enemy 😈",
            ['TargetGang'] = "Target Gang",
            ['Table'] = "Table",
            ['Lost'] = "LOST",
            ['Won'] = "WON",

            ['Time'] = "Time ⏲️"
        },

        -- To change a webhook color you need to set the decimal value of a color, you can use this website to do that - https://www.mathsisfun.com/hexadecimal-decimal-colors.html
        Colors = {
            ['editGangDatas1'] = 3093151, 
            ['gangCreation1'] = 3145375,
            ['gangDeleted1'] = 16121856,
            ['scout1'] = 3145375,
            ['raidStart1'] = 3145375,
            ['raidEnd1'] = 5845663,
        }
    },
}
client-utils.lua
ESX = Core
QBCore = Core

-- Buy here: (4€+VAT) https://store.brutalscripts.com
function notification(title, text, time, type)
    if Config.BrutalNotify then
        exports['brutal_notify']:SendAlert(title, text, time, type)
    else
        -- Put here your own notify and set the Config.BrutalNotify to false
        SetNotificationTextEntry("STRING")
        AddTextComponentString(text)
        DrawNotification(0,1)

        -- Default ESX Notify:
        --TriggerEvent('esx:showNotification', text)

        -- Default QB Notify:
        --TriggerEvent('QBCore:Notify', text, 'info', 5000)

        -- OKOK Notify:
        -- exports['okokNotify']:Alert('Gangs', text, time, type, false)

    end
end

function TextUIFunction(type, text)
    if type == 'open' then
        if Config.TextUI:lower() == 'ox_lib' then
            lib.showTextUI(text)
        elseif Config.TextUI:lower() == 'okoktextui' then
            exports['okokTextUI']:Open(text, 'darkblue', 'right')
        elseif Config.TextUI:lower() == 'esxtextui' then
            ESX.TextUI(text)
        elseif Config.TextUI:lower() == 'qbdrawtext' then
            exports['qb-core']:DrawText(text,'left')
        elseif Config.TextUI:lower() == 'brutal_textui' then
            exports['brutal_textui']:Open(text, "blue")
        end
    elseif type == 'hide' then
        if Config.TextUI:lower() == 'ox_lib' then
            lib.hideTextUI()
        elseif Config.TextUI:lower() == 'okoktextui' then
            exports['okokTextUI']:Close()
        elseif Config.TextUI:lower() == 'esxtextui' then
            ESX.HideUI()
        elseif Config.TextUI:lower() == 'qbdrawtext' then
            exports['qb-core']:HideText()
        elseif Config.TextUI:lower() == 'brutal_textui' then
            exports['brutal_textui']:Close()
        end
    end
end

function InventoryOpenFunction(type, job, size)
    if type == 'stash' then
        if Config.Inventory:lower() == 'ox_inventory' then
            exports.ox_inventory:openInventory('stash', { id = "stash_"..job})
        elseif Config.Inventory:lower() == 'qb_inventory' then
            if GetResourceState('qb-inventory') == "started" then
                TriggerServerEvent("brutal_gangs:qb-inventory:server:OpenInventory", "stash_"..job, {label = Config.Locales.Stashes, maxweight = size*1000, slots = 100})
            else
                TriggerServerEvent("inventory:server:OpenInventory", "stash", "stash_"..job, {label = Config.Locales.Stashes, maxweight = size*1000, slots = 100})
                TriggerEvent("inventory:client:SetCurrentStash", "stash_"..job)
            end
        elseif Config.Inventory:lower() == 'quasar_inventory' then
            TriggerServerEvent("inventory:server:OpenInventory", "stash", "stash_"..job, { label = Config.Locales.Stashes, maxweight = size*1000, slots = 100 })
            TriggerEvent("inventory:client:SetCurrentStash", "stash_"..job)
        elseif Config.Inventory:lower() == 'codem_inventory' then
            TriggerServerEvent("inventory:server:OpenInventory", "stash", "stash_"..job, { label = Config.Locales.Stashes, maxweight = size*1000, slots = 100 })
            TriggerEvent("inventory:client:SetCurrentStash", "stash_"..job)
        elseif Config.Inventory:lower() == 'chezza_inventory' then
            TriggerEvent('inventory:openStorage', Config.Locales.Stashes, "stash_"..job, size, 1000, {job})
        elseif Config.Inventory:lower() == 'core_inventory' then
            TriggerServerEvent('core_inventory:server:openInventory', "stash_"..job, "big_storage")
        elseif Config.Inventory:lower() == 'origen_inventory' then
            exports.origen_inventory:openInventory("stash", "stash_"..job, {label = Config.Locales.Stashes, maxweight = size*1000, slots = 100})
        elseif Config.Inventory:lower() == 'ps-inventory' then
            if GetResourceState('ps-inventory') == "started" then
                TriggerServerEvent("ps-inventory:server:OpenInventory", "stash_"..job, {label = Config.Locales.Stashes, maxweight = size*1000, slots = 100})
                TriggerEvent("ps-inventory:client:SetCurrentStash", "stash_"..job)
            else
                TriggerServerEvent("inventory:server:OpenInventory", "stash", "stash_"..job, {label = Config.Locales.Stashes, maxweight = size*1000, slots = 100})
                TriggerEvent("inventory:client:SetCurrentStash", "stash_"..job)
            end
        elseif Config.Inventory:lower() == 'tgiann-inventory' then
            exports["tgiann-inventory"]:OpenInventory("stash", "stash_"..job, {label = Config.Locales.Stashes, maxweight = size*1000, slots = 100})
        end
    elseif type == 'safe' then
        if Config.Inventory:lower() == 'ox_inventory' then
            exports.ox_inventory:openInventory('stash', { id = "safe_"..job})
        elseif Config.Inventory:lower() == 'qb_inventory' then
            if GetResourceState('qb-inventory') == "started" then
                TriggerServerEvent("brutal_gangs:qb-inventory:server:OpenInventory", "safe_"..job, {label = Config.Locales.Safe, maxweight = size*1000, slots = 50})
            else
                TriggerServerEvent("inventory:server:OpenInventory", "stash", "safe_"..job, {label = Config.Locales.Safe, maxweight = size*1000, slots = 50})
                TriggerEvent("inventory:client:SetCurrentStash", "safe_"..job)
            end
        elseif Config.Inventory:lower() == 'quasar_inventory' then
            TriggerServerEvent("inventory:server:OpenInventory", "stash", "safe_"..job, {label = Config.Locales.Safe, maxweight = size*1000, slots = 50})
            TriggerEvent("inventory:client:SetCurrentStash", "safe_"..job)
        elseif Config.Inventory:lower() == 'codem_inventory' then
            TriggerServerEvent("inventory:server:OpenInventory", "stash", "safe_"..job, {label = Config.Locales.Safe, maxweight = size*1000, slots = 50})
            TriggerEvent("inventory:client:SetCurrentStash", "safe_"..job)
        elseif Config.Inventory:lower() == 'chezza_inventory' then
            TriggerEvent('inventory:openStorage', Config.Locales.Stashes, "safe_"..job, size, 1000, {job})
        elseif Config.Inventory:lower() == 'core_inventory' then
            TriggerServerEvent('core_inventory:server:openInventory', "safe_"..job, "stash")
        elseif Config.Inventory:lower() == 'origen_inventory' then
            exports.origen_inventory:openInventory("stash", "safe_"..job, {label = Config.Locales.Safe, maxweight = size*1000, slots = 50})
        elseif Config.Inventory:lower() == 'ps-inventory' then
            if GetResourceState('ps-inventory') == "started" then
                TriggerServerEvent("ps-inventory:server:OpenInventory", "safe_"..job, {label = Config.Locales.Safe, maxweight = size*1000, slots = 50})
                TriggerEvent("ps-inventory:client:SetCurrentStash", "safe_"..job)
            else
                TriggerServerEvent("inventory:server:OpenInventory", "stash", "safe_"..job, {label = Config.Locales.Safe, maxweight = size*1000, slots = 50})
                TriggerEvent("inventory:client:SetCurrentStash", "safe_"..job)
            end
        elseif Config.Inventory:lower() == 'tgiann-inventory' then
            exports["tgiann-inventory"]:OpenInventory("stash", "safe_"..job, {label = Config.Locales.Safe, maxweight = size*1000, slots = 50})
        end
    end
end

function OpenDressingMenu()
    if Config.Wardrobe == 'ak47_clothing' then
        exports['ak47_clothing']:openOutfit() -- if it doesn't work with this export use other event
        -- TriggerEvent('ak47_clothing:openOutfitMenu') -- Use this only if the first export doesn't work, depend of you'r version
    elseif Config.Wardrobe == 'codem_apperance' then 
        TriggerEvent('codem-apperance:OpenWardrobe')
    elseif Config.Wardrobe == 'fivem_appearance' then 
        exports['fivem-appearance']:openWardrobe()
    elseif Config.Wardrobe == 'illenium_appearance' then 
        TriggerEvent('illenium-appearance:client:openOutfitMenu')
    elseif Config.Wardrobe == 'qb_clothing' then 
        TriggerEvent('qb-clothing:client:openOutfitMenu')
    elseif Config.Wardrobe == 'raid_clothes' then 
        TriggerEvent('raid_clothes:openmenu')
    elseif Config.Wardrobe == 'rcore_clothes' then 
        TriggerEvent('rcore_clothes:openOutfits')
    elseif Config.Wardrobe == 'rcore_clothing' then 
        TriggerEvent('rcore_clothing:openChangingRoom')
    elseif Config.Wardrobe == 'sleek_clothestore' then 
        exports['sleek-clothestore']:OpenWardrobe()
    elseif Config.Wardrobe == 'tgiann_clothing' then 
        TriggerEvent('tgiann-clothing:openOutfitMenu')
    end
end

function setPlayerSkin(skinTable)
    if Config['Core']:upper() == 'ESX' then
        TriggerEvent('skinchanger:loadSkin', skinTable.skin)
    elseif Config['Core']:upper() == 'QBCORE' then
        TriggerEvent("qb-clothes:loadSkin", false, tonumber(skinTable.model), skinTable.skin)
        TriggerServerEvent("brutal_gangs:server:qbcore-loadPlayerSkin", tonumber(skinTable.model), skinTable.skin)
    end
end

RegisterNetEvent('brutal_gangs:client:utils:CreateVehicle')
AddEventHandler('brutal_gangs:client:utils:CreateVehicle', function(Vehicle)
    local plate = GetVehicleNumberPlateText(Vehicle)

    SetVehicleFuelLevel(Vehicle, 100.0)
    DecorSetFloat(Vehicle, "_FUEL_LEVEL", GetVehicleFuelLevel(Vehicle))

    if Config.BrutalKeys and GetResourceState("brutal_keys") == "started" then 
        exports.brutal_keys:addVehicleKey(plate, plate) 
    end

    if Config['Core']:upper() == 'QBCORE' then
        TriggerEvent("vehiclekeys:client:SetOwner", QBCore.Functions.GetPlate(Vehicle))
    end
end)

RegisterNetEvent('brutal_gangs:client:utils:DeleteVehicle')
AddEventHandler('brutal_gangs:client:utils:DeleteVehicle', function(Vehicle)
    local plate = GetVehicleNumberPlateText(Vehicle)

    if Config.BrutalKeys and GetResourceState("brutal_keys") == "started" then 
		exports.brutal_keys:removeKey(plate, true) 
	end	

    DeleteEntity(Vehicle)
end)

function OpenMenuUtil()
    InMenu = true
    SetNuiFocus(true, true)

    Citizen.CreateThread(function()
        while InMenu do
            N_0xf4f2c0d4ee209e20() -- it's disable the AFK camera zoom
            Citizen.Wait(15000)
        end 
    end)

    DisplayRadar(false)
end

function DisableMinimap()
    DisplayRadar(false)
    -- Here you can add a trigger to hide your HUD system
end

function EnableMinimap()
    DisplayRadar(true)
    -- Here you can add a trigger to enable your HUD system
end

RegisterNetEvent('brutal_gangs:client:utils:StartExternalTask')
AddEventHandler('brutal_gangs:client:utils:StartExternalTask', function()
    -- Put here any robbery or heist you want to start from the gangmenu 
end)
server-utils.lua
local YourWebhook = 'YOUR-WEBHOOK'  -- help: https://docs.brutalscripts.com/site/others/discord-webhook

function GetWebhook()
    return YourWebhook
end

RESCB("brutal_gangs:server:StaffCheck",function(source,cb,groups)
    local src = source

    cb(StaffCheck(src, groups))
end)

RESCB("brutal_gangs:server:GetDressing",function(source,cb)
    local src = source
    local dressingTable = {}
    local dataArrived = false

    if Config['Core']:upper() == 'ESX' then
        TriggerEvent('esx_datastore:getDataStore', 'property', GetIdentifier(src), function(store)
            local dressings = store.get('dressing') or {}
        
            for k,v in pairs(dressings) do
                table.insert(dressingTable, {label = v.label, skin = v.skin})
            end
        end)
        dataArrived = true
    elseif Config['Core']:upper() == 'QBCORE' then
        local results = MySQL.query.await('SELECT * FROM player_outfits WHERE citizenid = ?', { GetIdentifier(src) })
        for k, v in pairs(results) do
            table.insert(dressingTable, {label = v.outfitname ~= "" and v.outfitname or "None", skin = results[k].skin, model = v.model})
        end
        dataArrived = true
    end

    while not dataArrived do
        Citizen.Wait(10)
    end

    cb(dressingTable)
end)

function StaffCheck(source, AdminGroups)
    local staff = false

    if Config.Core:upper() == 'ESX'then
        local player = Core.GetPlayerFromId(source)
        local playerGroup = player.getGroup()

        for i, Group in ipairs(AdminGroups) do
            if playerGroup == Group then
                staff = true
                break
            end
        end
    elseif Config.Core:upper() == 'QBCORE' then

        for i, Group in ipairs(AdminGroups) do
            if Core.Functions.HasPermission(source, Group) or IsPlayerAceAllowed(source, Group) or IsPlayerAceAllowed(source, 'command') then
                staff = true
                break
            end
        end
    end

    return staff
end

RegisterNetEvent("brutal_gangs:server:qbcore-loadPlayerSkin")
AddEventHandler("brutal_gangs:server:qbcore-loadPlayerSkin", function(model, skin)
    local src = source

    if model ~= nil and skin ~= nil then
        MySQL.query('DELETE FROM playerskins WHERE citizenid = ?', { GetIdentifier(src) }, function()
            MySQL.insert('INSERT INTO playerskins (citizenid, model, skin, active) VALUES (?, ?, ?, ?)', {
                GetIdentifier(src),
                model,
                skin,
                1
            })
        end)
    end
end)
client-core.lua
Core = nil

if Config['Core']:upper() == 'ESX' then
    local _esx_ = 'new' -- 'new' / 'old'

    if _esx_ then
        Core = exports['es_extended']:getSharedObject()
    else
        while Core == nil do
            TriggerEvent('esx:getSharedObject', function(obj) Core = obj end)
            Citizen.Wait(0)
        end
    end

    LoadedEvent = 'esx:playerLoaded'
    ReviveEvent = 'esx_ambulancejob:revive'
    JobUpdateEvent = 'esx:setJob'
    TSCB = Core.TriggerServerCallback

    function GetPlayerJobDatas()
        return Core.GetPlayerData().job
    end

    function GetPlayersFunction()
        return Core.Game.GetPlayers()
    end

    function GetVehiclePropertiesFunction(vehicle)
        return Core.Game.GetVehicleProperties(vehicle)
    end

    function SetVehiclePropertiesFunction(vehicle, properties)
        return Core.Game.SetVehicleProperties(vehicle, properties)
    end

    function GetClosestVehicleFunction(coords, modelFilter)
        return Core.Game.GetClosestVehicle(coords, modelFilter)
    end

elseif Config['Core']:upper() == 'QBCORE' then
    Core = exports['qb-core']:GetCoreObject()

    LoadedEvent = 'QBCore:Client:OnPlayerLoaded'
    ReviveEvent = 'hospital:client:Revive'
    JobUpdateEvent = 'QBCore:Client:OnGangUpdate'
    TSCB = Core.Functions.TriggerCallback

    function GetPlayerJobDatas()
        return Core.Functions.GetPlayerData().gang
    end

    function GetPlayersFunction()
        return Core.Functions.GetPlayers()
    end

    function GetVehiclePropertiesFunction(vehicle)
        return Core.Functions.GetVehicleProperties(vehicle)
    end

    function SetVehiclePropertiesFunction(vehicle, properties)
        return Core.Functions.SetVehicleProperties(vehicle, properties)
    end

    function GetClosestVehicleFunction(coords, modelFilter)
        return Core.Functions.GetClosestVehicle(coords, modelFilter)
    end
    
end
server-core.lua
Core = nil

if Config['Core']:upper() == 'ESX' then
    local _esx_ = 'new' -- 'new' / 'old'
    
    if _esx_ == 'new' then
        Core = exports['es_extended']:getSharedObject()
    else
        Core = nil
        TriggerEvent('esx:getSharedObject', function(obj) Core = obj end)
        while Core == nil do
            Citizen.Wait(0)
        end
    end

    RESCB = Core.RegisterServerCallback
    GETPFI = Core.GetPlayerFromId
    RUI = Core.RegisterUsableItem
    SetJobEvent = 'esx:setJob'
    onPlayerDeath = 'esx:onPlayerDeath'
    SQLData = {
        users = 'users',
        job = 'job',
        jobs = 'jobs',

    }

    function GetIdentifier(source)
        local xPlayer = GETPFI(source)
        while xPlayer == nil do
            Citizen.Wait(1000)
            xPlayer = GETPFI(source) 
        end
        return xPlayer.identifier
    end

    function GetPlayerByIdentifier(identifier)
        return Core.GetPlayerFromIdentifier(identifier)
    end

    function GetAccountMoney(source,account)
        local xPlayer = GETPFI(source)
        if account == 'bank' then
            return xPlayer.getAccount(account).money
        elseif account == 'money' then
            return xPlayer.getMoney()
        end
    end

    function AddMoneyFunction(source, account, amount)
        local xPlayer = GETPFI(source)
        if account == 'bank' then
            xPlayer.addAccountMoney('bank', amount)
        elseif account == 'money' then
            xPlayer.addMoney(amount)
        end
    end

    function RemoveAccountMoney(source, account, amount)
        local xPlayer = GETPFI(source)
        if account == 'bank' then
            xPlayer.removeAccountMoney('bank', amount)
        elseif account == 'money' then
            xPlayer.removeMoney(amount)
        end
    end

    function GetItemCount(source, item)
        local xPlayer = GETPFI(source)

        if xPlayer.getInventoryItem(item) == nil then
            print("^1PROBLEM!^7 The ^3" ..item.. "^7 item is not created.")
            return 0
        end

        if _esx_ == 'new' then
            return xPlayer.getInventoryItem(item).count
        else
            if string.sub(item, 0, 6):lower() == 'weapon' then
                local loadoutNum, weapon = xPlayer.getWeapon(item:upper())

                if weapon then
                    return true
                else
                    return false
                end
            else
                return xPlayer.getInventoryItem(item).count
            end
        end
    end
    
    function RemoveItem(source, item, amount)
        local xPlayer = GETPFI(source)
        if _esx_ == 'new' then
            xPlayer.removeInventoryItem(item, amount)
        else
            if string.sub(item, 0, 6):lower() == 'weapon' then
                xPlayer.removeWeapon(item)
            else
                xPlayer.removeInventoryItem(item, amount)
            end
        end
    end

    function AddItem(source, item, count, info)
        local xPlayer = GETPFI(source)
        if _esx_ == 'new' then
            xPlayer.addInventoryItem(item, count, info)
        else
            if string.sub(item, 0, 6):lower() == 'weapon' then
                xPlayer.addWeapon(item, 90)
            else
                xPlayer.addInventoryItem(item, count)
            end
        end
    end

    function GetPlayerNameFunction(source)
        local name
        if Config.SteamName then
            name = GetPlayerName(source) or 'No Data'
        else
            local xPlayer = GETPFI(source)
            name = xPlayer.getName() or 'No Data'
        end
        return name
    end

    function GetPlayerJob(source)
        local xPlayer = GETPFI(source)
        return xPlayer.job.name
    end

    function CreateCoreJob(name, label, grades)
        Core.CreateJob(name, label, grades)
    end

    function SetCoreJob(source, job, grade)
        local xPlayer = GETPFI(source)
        xPlayer.setJob(job, grade)
    end

    function SetCoreJobOffline(identifier, job, grade)
        MySQL.update('UPDATE users SET job = ?, job_grade = ? WHERE identifier = ?', {job, grade, identifier})
    end

elseif Config['Core']:upper() == 'QBCORE' then

    Core = exports['qb-core']:GetCoreObject()
    
    RESCB = Core.Functions.CreateCallback
    GETPFI = Core.Functions.GetPlayer
    RUI = Core.Functions.CreateUseableItem
    SetJobEvent = 'QBCore:Server:SetGang'
    onPlayerDeath = GetResourceState("brutal_ambulancejob") == "started" and 'onPlayerDeath' or 'hospital:server:SetDeathStatus'
    SQLData = {
        players = 'players',
    }

    function GetIdentifier(source)
        local xPlayer = GETPFI(source)
        while xPlayer == nil do
            Citizen.Wait(1000)
            xPlayer = GETPFI(source) 
        end
        return xPlayer.PlayerData.citizenid
    end

    function GetPlayerByIdentifier(identifier)
        return Core.Functions.GetPlayerByCitizenId(identifier)
    end

    function GetAccountMoney(source, account)
        local xPlayer = GETPFI(source)
        if account == 'bank' then
            return xPlayer.PlayerData.money.bank
        elseif account == 'money' then
            return xPlayer.PlayerData.money.cash
        end
    end

    function AddMoneyFunction(source, account, amount)
        local xPlayer = GETPFI(source)
        if account == 'bank' then
            xPlayer.Functions.AddMoney('bank', amount)
        elseif account == 'money' then
            xPlayer.Functions.AddMoney('cash', amount)
        end
    end

    function RemoveAccountMoney(source, account, amount)
        local xPlayer = GETPFI(source)
        if account == 'bank' then
            xPlayer.Functions.RemoveMoney('bank', amount)
        elseif account == 'money' then
            xPlayer.Functions.RemoveMoney('cash', amount)
        end
    end

    function GetItemCount(source, item)
        local xPlayer = GETPFI(source)
        local items = xPlayer.Functions.GetItemByName(item)
        local item_count = 0
        if items ~= nil then
            item_count = items.amount
        else
            item_count = 0
        end
        return item_count
    end

    function RemoveItem(source, item, amount)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.RemoveItem(item, amount)
    end

    function AddItem(source, item, count, info)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.AddItem(item, count, nil, info)
    end

    function GetPlayerNameFunction(source)
        local name
        if Config.SteamName then
            name = GetPlayerName(source)
        else
            local xPlayer = GETPFI(source)
            name = xPlayer.PlayerData.charinfo.firstname..' '..xPlayer.PlayerData.charinfo.lastname
        end
        return name
    end

    function GetPlayerJob(source)
        local xPlayer = GETPFI(source)
        return xPlayer.PlayerData.gang.name
    end

    function CreateCoreJob(name, label, grades)
        if GetResourceState("qbx_core") == "started" then
            local gang = {}
            local newValue, newGrades = {}, {}

            for k,v in pairs(grades) do
                newValue[#newValue+1] = { id = tonumber(k), data = v }
            end

            table.sort(newValue, function(a, b)
                return a.id < b.id
            end)

            for k,v in pairs(newValue) do
                newGrades[v.id] = v.data
            end

            gang[name] = {
                label = label,
                grades = newGrades,
            }

            return exports['qbx_core']:CreateGangs(gang)    
        else 
            Core.Functions.AddGang(name, 
            {
                label = label,
                grades = grades,
            })
        end
    end

    function UpdateCoreJob(name, label, grades)
        Core.Functions.UpdateGang(name, {
            label = label,
            grades = grades,
        })
    end

    function RemoveCoreJob(name)
        Core.Functions.RemoveGang(name)
    end

    function SetCoreJob(source, job, grade)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.SetGang(job, grade)
    end

    function SetCoreJobOffline(identifier, job)
        local joblabel = "None"
        if Gangs[job] ~= nil and Gangs[job].label ~= nil then
            joblabel = Gangs[job].label
        end

        MySQL.update('UPDATE players SET gang = ? WHERE citizenid = ?', {json.encode({grade = {level = 0, name = "Member"}, name = job, isboss = false, label = joblabel}), identifier})
    end
end

Last updated

Was this helpful?