Page cover image

Accessible files

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

config.lua
Config = {
    Core = 'ESX',  -- 'ESX' / 'QBCORE' | Other core setting on the 'core' folder.
    Inventory = 'ox_inventory', -- 'ox_inventory' / 'qb_inventory' / 'quasar_inventory' / 'chezza_inventory' / 'core_inventory' // Custom can be add in the cl_utils.lua!!!
    Billing = false, -- 'okokBilling' / 'esx_billing' / 'jaksam_billing' / 'codem_billing' / 'quasar_billing' | false = immediate deduction from the player's bank account
    TextUI = 'ox_lib', -- 'ox_lib' / 'okokTextUI' / 'ESXTextUI' / 'QBDrawText' // Custom can be add in the cl_utils.lua!!!
    ProgressBar = '', -- 'progressBars' / 'pogressBar' / 'mythic_progbar' // Custom can be add in the cl_utils.lua!!!
    BrutalNotify = true, -- Buy here: (4€+VAT) https://store.brutalscripts.com | Or set up your own notify >> cl_utils.lua
    SteamName = false, -- true = Steam name | false = character name
    DateFormat = '%d/%m/%Y', -- Date format
    CustomOutfitMenu = false, -- If it's true, it will open a custom outfit menu, what you can edit in the cl_utils.lua line 103.
    
    MechanicJobs = {
        ["Benny's"] = {
            Job = 'mechanic', -- Job name
            Duty = vector3(-206.8119, -1339.2422, 34.8944), -- Duty ON / OFF coords

            Blip = {use = true, color = 5, sprite = 446, size = 0.8}, -- Job blip
            Marker = {use = true, marker = 20, rgb = {15, 100, 210}, bobUpAndDown = true, rotate = false},

            Cloakrooms = {
                vector3(-212.0843, -1331.6995, 23.1426),
                -- You can add more...
            },

            Armorys = {
                vector3(-241.7455, -1333.1143, 30.9028),
                -- You can add more...
            },

            BossMenu = {
                grades = {4},
                coords = {
                    vector3(-196.1315, -1340.1720, 34.8994),
                    -- You can add more...
                }
            },

            Garages = {
                {
                    Label = 'Garage I.', -- Gargae Label
                    menu = vector3(-196.9752, -1308.9575, 31.2943), -- Garage menu open coords
                    spawn = vector4(-192.3368, -1303.9343, 31.2601, 87.7941), -- Vehicle spawn coords
                    deposit = vector3(-192.3368, -1303.9343, 31.2601), -- Vehicle deposit place

                    vehicles = {
                        --['MODEL'] = {
                        --    Label = 'VEHICLE-LABEL',
                        --    minRank = MINIMUM-GRADE
                        --},

                        ['flatbed'] = {
                            Label = 'Flatbed',
                            minRank = 1
                        },
        
                        ['towtruck2'] = {
                            Label = 'Towtruck',
                            minRank = 2
                        },
                    }
                },

                -- You can add more...
            },

            RepairVehicles = {'flatbed', 'towtruck2'}, -- Add here the all mechanic vehicles.

            OtherLocations = {
                ToolBox = vector3(-241.2709, -1326.3794, 30.9028),
                Doors = vector3(-221.6548, -1332.9108, 30.8902),
                Windows = vector3(-219.4136, -1320.6279, 30.8902),
                Tyre = vector3(-227.7675, -1333.9160, 30.8902),
                Suspension = vector3(-241.4563, -1323.2102, 30.9028),
            },

            Shop = {
                -- minGrade = The minimum grade to access to buy the item.
                {item = 'radio', label = 'Radio', price = 20, minGrade = 0},
                {item = 'tool_box', label = 'Tool Box', price = 250, minGrade = 0},
                {item = 'vehicle_door', label = 'Vehicle Door', price = 1250, minGrade = 0},
                {item = 'vehicle_window', label = 'Window', price = 350, minGrade = 0},
                {item = 'vehicle_tyre', label = 'Vehicle Tyre', price = 640, minGrade = 0},
                {item = 'suspension', label = 'Suspension', price = 1500, minGrade = 0},
            },
        },

        -----------------------------------------------------------
        --------------------------| LSC |--------------------------
        -----------------------------------------------------------

        ["LS Customs"] = {
            Job = 'mechanic2', -- Job name
            Duty = vector3(-347.0996, -133.5243, 39.0096), -- Duty ON / OFF coords

            Blip = {use = true, color = 5, sprite = 446, size = 0.8}, -- Job blip
            Marker = {use = true, marker = 20, rgb = {15, 100, 210}, bobUpAndDown = true, rotate = false},

            Cloakrooms = {
                vector3(-345.2404, -123.1227, 39.0097),
                -- You can add more...
            },

            Armorys = {
                vector3(-344.2655, -139.7523, 39.0097),
                -- You can add more...
            },

            BossMenu = {
                grades = {4},
                coords = {
                    vector3(-345.3236, -131.3823, 39.0097),
                    -- You can add more...
                }
            },

            Garages = {
                {
                    Label = 'Garage I.', -- Gargae Label
                    menu = vector3(-356.2040, -121.5005, 38.6962), -- Garage menu open coords
                    spawn = vector4(-366.5953, -118.6167, 38.6962, 167.8944), -- Vehicle spawn coords
                    deposit = vector3(-366.5974, -118.6033, 38.6962), -- Vehicle deposit place

                    vehicles = {
                        --['MODEL'] = {
                        --    Label = 'VEHICLE-LABEL',
                        --    minRank = MINIMUM-GRADE
                        --},

                        ['flatbed'] = {
                            Label = 'Flatbed',
                            minRank = 1
                        },
        
                        ['towtruck2'] = {
                            Label = 'Towtruck',
                            minRank = 2
                        },
                    }
                },

                -- You can add more...
            },

            RepairVehicles = {'flatbed', 'towtruck2'}, -- Add here the all mechanic vehicles.

            OtherLocations = {
                ToolBox = vector3(-323.4086, -129.6655, 39.0059),
                Doors = vector3(-329.3019, -127.9275, 39.0096),
                Windows = vector3(-331.2965, -127.1661, 39.0096),
                Tyre = vector3(-334.3046, -126.1228, 39.0097),
                Suspension = vector3(-341.5007, -140.6323, 39.0261),
            },

            Shop = {
                -- minGrade = The minimum grade to access to buy the item.
                {item = 'radio', label = 'Radio', price = 20, minGrade = 0},
                {item = 'tool_box', label = 'Tool Box', price = 250, minGrade = 0},
                {item = 'vehicle_door', label = 'Vehicle Door', price = 1250, minGrade = 0},
                {item = 'vehicle_window', label = 'Window', price = 350, minGrade = 0},
                {item = 'vehicle_tyre', label = 'Vehicle Tyre', price = 640, minGrade = 0},
                {item = 'suspension', label = 'Suspension', price = 1500, minGrade = 0},
            },
        },

    },

    VehicleLifts = {
        
        {
            menu = vector3(-226.7121, -1324.0067, 30.8902),
            elements = {
                {type = 'lifting', coords = {-223.763, -1321.936, 29.955}, rotations = {0.040, 0.040, -179.287}},
                {type = 'scaffolding', coords = {-223.770, -1321.929, 29.881}, rotations = {0.040, 0.040, 0.040}},
                {type = 'control-panel', coords = {-229.589, -1321.930, 31.407}, rotations = {0.040, 0.040, 0.040}},
            },
        },

        -- You can add more...
    },

    TowingVehicles = {
        ['flatbed'] = {
            OffsetCoords = {x = 0.0, y = -2.5},
            Ramp = {x = 0.0, y = -9.0, z = -1.25},
            BlackListedVehicles = {'bmx', 'bf400'},
        },

        -- You can add more...
    },

    MechanicItems = {
        -- You must create these items on the server!
        
        ["tool_box"] = {
            name = "tool_box",
            label = "Tool Box",
        },

        ["vehicle_door"] = {
            name = "vehicle_door",
            label = "Vehicle Door",
        },

        ["vehicle_window"] = {
            name = "vehicle_window",
            label = "Vehicle Window",
        },

        ["vehicle_tyre"] = {
            name = "vehicle_tyre",
            label = "Vehicle Tyre"
        },

        ["suspension"] = {
            name = "suspension",
            label = "Suspension",
        },

    },

    NPCJobBlips = {label = 'NPC JOB', color = 2, sprite = 1, size = 0.7},
    NPCJobs = {
        {vehicle = 'baller', npc = 'a_m_m_bevhills_02', pay = {100, 300}, coords = vector4(1145.6260, -275.3784, 68.3996, 273.6313)},
        {vehicle = 'rhapsody', npc = 'a_m_m_bevhills_02', pay = {100, 300}, coords = vector4(-713.7045, -174.2154, 36.2662, 26.3143)},
        {vehicle = 'regina', npc = 'a_m_m_bevhills_02', pay = {100, 300}, coords = vector4(1576.8358, 952.5146, 77.5703, 336.9504)},
        {vehicle = 'comet7', npc = 'a_m_m_bevhills_02', pay = {100, 300}, coords = vector4(-1932.8256, -534.3582, 11.2592, 292.5941)},
        {vehicle = 'futo', npc = 'a_m_m_bevhills_02', pay = {100, 300}, coords = vector4(-1186.1283, -742.4856, 19.5467, 307.2391)},
    },

    QuickRepairPoints = {
        {coords = vector3(-233.8778, -1316.5942, 30.8805), jobs = {'mechanic', 'ambulance'}, price = 5000, time = 10, marker = {use = true, type = 42, rgb = {15, 100, 210}, rotate = true}},
        -- You can add more...
    },

    Commands = {
        
        Duty = {
            Use = true,
            Command = 'mduty', 
            Suggestion = 'Entering/Exiting duty'
        },

        JobMenu = {
            Command = 'mjobmenu', 
            Control = '',  -- Controls list:  https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
            Suggestion = 'Open Job Menu'
        },

        DiagnosticTablet = {
            Command = 'mtablet', 
            Control = '',  -- Controls list:  https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
            Suggestion = 'Open Diagnostic Tablet',
            LoadingTime = 8, -- (sec) This is how long it takes to open the menu. For example 8 = fast, 12 = slow
        },

        BillingMenu = {
            Use = true,
            Command = 'mbilling', 
            Suggestion = 'To open the Billing menu',

            MaxBillingAmount = 100000, -- The billing amount cannot be higher than this value.
            BasicBillTypes = {
                ['mechanic'] = {
                    {'Vehicle Clean', 25},
                    {'Vehicle Fix', 500},
                    {'Engine Fix', 1000},
                    {'Door Fix', 250},
                    {'Window Fix', 100},
                },

                ['mechanic2'] = {
                    {'Vehicle Clean', 25},
                    {'Vehicle Fix', 500},
                    {'Engine Fix', 1000},
                    {'Door Fix', 250},
                    {'Window Fix', 100},
                },
            }
        },

        MechanicCalls = {
            Command = 'mcalls',
            Control = '',  -- Controls list:  https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
            Suggestion = 'Show Mechanic Calls'
        },

        VehicleTowing = {
            Use = true,
            Command = 'towing', 
            Suggestion = 'Towing of vehicle'
        },

        NPCJobs = {
            Use = true,
            Command = 'mnpcjobs', 
            Suggestion = 'Start an NPC Job'
        },

        TaskMenu = {
            Command = 'taskmenu', 
            Suggestion = 'To Hide/Show the task menu'
        },

        -- For Civils

        CreateMechanicCall = {
            Command = 'mcall',
            Control = '',  -- Controls list:  https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/
            Suggestion = 'Create Call Menu'
        },

        VehiclePushing = {
            Use = true,
            Command = 'vpushing', 
            Suggestion = 'To push the Vehicle'
        },

        MechanicAnimation = {
            Command = 'manimation', 
            Suggestion = 'To use a mechanic animation'
        },
    },

    -----------------------------------------------------------
    -----------------------| TRANSLATE |-----------------------
    -----------------------------------------------------------

    MoneyForm = '$', -- Money form

    Locales = {
        VehiclePushing = '~b~Vehicle Pushing\n~w~Rotate with ~INPUT_CELLPHONE_LEFT~ & ~INPUT_CELLPHONE_RIGHT~\n~r~Cancel~w~ ~INPUT_FRONTEND_RRIGHT~',

        CloakRoom = 'Cloak Room',
        GarageMenu = 'Garage Menu',

        Vehicle = 'Vehicle',
        Objects = 'Objects',
        NPCJobs = 'NPC Jobs',
        Billing = 'Billing',
        DiagnosticTablet = 'Diagnostic Tablet',
        Impound = 'Impound',
        Cleaning = 'Cleaning',
        Open = 'Open',
        Towing = 'Towing',
        Ramp = 'Ramp',

        Seconds = 'second(s)',
    },

    Progressbar = {
        DutyOFF = 'Duty OFF...',
        DutyON = 'Duty ON...',
        Impound = 'Impound...',
        Cleaning = 'Cleaning...',
        Openning = 'Openning...',
        ObjectPlacing = 'Placing the Object...',
        Repair = 'Repair...',
    },

    Texts = {
        [1] = {'[E] - To open the dress menu', 38},
        [2] = {'[E] - To open the armory menu', 38},
        [3] = {'[E] - To open the garage menu', 38},
        [4] = {'[E] - To deposit the vehicle', 38},
        [5] = {'[E] - To Duty ON', '[E] - To Duty OFF', 38},
        [6] = {'[E] - To open the Boss Menu', 38},
        [7] = {'[E] - Vehicle Lift Control', 38},
        [8] = {'[E] - To pick up/put down the Object', 38},
        [9] = {'[E] - To quick fix the Vehicle', 38},
        [10] = {'[E] - To get your stuff', 38},
        [11] = {'[E] - To fix the issue', 38},
        [12] = {'[E] - To get the money', 38},
    },
    
    -- Notify function EDITABLE >> cl_utils.lua
    Notify = {
        [1] = {"MECHANIC JOB", "No vehicle available for your rank.", 5000, "error"},
        [2] = {"MECHANIC JOB", "You can't deposit this Vehicle.", 5000, "error"},
        [3] = {"MECHANIC JOB", "Duty status: <b>ON", 5000, "info"},
        [4] = {"MECHANIC JOB", "Duty status: <b>OFF", 5000, "info"},
        [5] = {"MECHANIC JOB", "You don't have enough money!", 5000, "error"},
        [6] = {"MECHANIC JOB", "Please DO NOT SPAM!", 8000, "error"},
        [7] = {"MECHANIC JOB", "You must be in Vehicle!", 5000, "error"},
        [8] = {"MECHANIC JOB", "You must be in the driver's seat.", 5000, "error"},
        [9] = {"MECHANIC JOB", "This is not a Tow Vehicle!", 5000, "error"},
        [10] = {"MECHANIC JOB", "There is no vehicle near you!", 5000, "error"},
        [11] = {"MECHANIC JOB", "This Vehicle cannot be used!", 5000, "error"},
        [12] = {"MECHANIC JOB", "You cannot be in the Vehicle!", 5000, "error"},
        [13] = {"MECHANIC JOB", "The vehicle must be free!", 5000, "error"},
        [14] = {"MECHANIC JOB", "There isn't any mechanic car near you!", 5000, "error"},
        [15] = {"MECHANIC JOB", "You paid the mechanic:", 5000, "info"},
        [16] = {"MECHANIC JOB", "You have successfully created a fine!", 6000, "success"},
        [17] = {"MECHANIC JOB", "You have successfully fixed the Vehicle! Grab the money from the Client!", 6000, "success"},
        [18] = {"MECHANIC JOB", "You got:<b>", 6000, "success"},
        [19] = {"MECHANIC JOB", "New Mechanic Call has arrived.", 6000, "info"},
        [20] = {"MECHANIC JOB", "You have successfully submitted!", 6000, "success"},
        [21] = {"MECHANIC JOB", "You have closed the Call!", 6000, "success"},
        [22] = {"MECHANIC JOB", "<br>You spent:<b>", 5000, "info"},
        [23] = {"MECHANIC JOB", "Stop with the vehicle!", 5000, "info"},
        [24] = {"MECHANIC JOB", "You have <b>started</b> the job!<br>Drive to the designated place!", 5000, "info"},
        [25] = {"MECHANIC JOB", "You have <b>finished</b> the job!", 5000, "info"},
        [26] = {"MECHANIC JOB", "Fix the client's car! Go to the back of the car!", 5000, "info"},
        [27] = {"MECHANIC JOB", "You have to sit in a mechanic car.", 5000, "error"},
        [28] = {"MECHANIC JOB", "Attached: <b>ON", 5000, "error"},
        [29] = {"MECHANIC JOB", "Attached: <b>OFF", 5000, "error"},
        [30] = {"MECHANIC JOB", "Vehicle is: <b>unlocked", 5000, "info"},
        [31] = {"MECHANIC JOB", "The billing amount <b>cannot be higher</b> than", 5000, "info"},
        [32] = {"MECHANIC JOB", "You paid:", 5000, "info"},
        [33] = {"MECHANIC JOB", "You have to wait", 5000, "error"},
        [34] = {"MECHANIC JOB", "You must have:", 5000, "error"},
        [35] = {"MECHANIC JOB", "The vehicle must not move!", 5000, "error"},
        [36] = {"MECHANIC JOB", "Something is already in progress!", 5000, "error"},
        [37] = {"MECHANIC JOB", "You need to fix the suspension first!", 5000, "error"},
        [38] = {"MECHANIC JOB", "You have to wait to open the menu.", 5000, "error"},
        [39] = {"MECHANIC JOB", "Task Menu: <b>ON", 5000, "info"},
        [40] = {"MECHANIC JOB", "Task Menu: <b>OFF", 5000, "info"},
    },

    DiagnosticTablet = {
        {"To repair the engine use one of the engine repair items."},
        {"To repair the chassis use one of the chassis repair items."},
        {"To repair the tyres use one of the tyre repair items."},
        {"To repair the suspension use one of the suspension replaces."},
        {"There isn't any problem with this part."},
    },

    Tasks = {
        Engine = {"Pick up the toolbox", "Repair the engine", "Put down the toolbox"},
        Chassis = {"Pick up the toolbox", "Fix the vehicle's body", "Put down the toolbox", "Repair the door(s)", "Repair the window(s)"},
        Tyres = {"Pick up the Car Jack", "Position the Car Jack", "Remove the tire", "Take off the old tire", "Pick up the new tire", "Place the tire", "Pick up the Car Jack", "Put down the Car Jack"},
        Suspension = {"Pick up the toolbox", "Suspension repair", "Put down the toolbox"},
    },

    VehicleClasses = {
        [0] = "Compacts",  
        [1] = "Sedans", 
        [2] = "SUVs",   
        [3] = "Coupes",   
        [4] = "Muscle",   
        [5] = "Sports Classics",   
        [6] = "Sports",   
        [7] = "Super",   
        [8] = "Motorcycles",   
        [9] = "Off-road",   
        [10] = "Industrial",   
        [11] = "Utility",   
        [12] = "Vans",   
        [13] = "Cycles",   
        [14] = "Boats",   
        [15] = "Helicopters",   
        [16] = "Planes",   
        [17] = "Service",   
        [18] = "Emergency",   
        [19] = "Military",   
        [20] = "Commercial",   
        [21] = "Trains",   
        [22] = "Open Wheel", 
    },
    
    Webhooks = {
        Use = true, -- Use webhooks? true / false
        Locale = {
            ['ItemBought'] = 'Item Bought',
            ['InvoiceCreated'] = 'Invoice Created',
            ['CallOpen'] = 'Call - Open',
            ['CallClose'] = 'Call - Close',

            ['PlayerName'] = 'Player Name',
            ['AdminName'] = 'Admin Name',
            ['Identifier'] = 'Identifier',
            ['Items'] = 'Items',
            ['Text'] = 'Text',
            ['Callid'] = 'Call ID',
            ['Coords'] = 'Coords',
            ['Assistant'] = 'Assistant',
            ['Receiver'] = 'Receiver',
            ['Amount'] = 'Amount',
            ['Job'] = 'Job',

            ['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 = {
            ['CallOpen'] = 3145631, 
            ['CallClose'] = 16711680,
            ['ItemBought'] = 14261503,
            ['InvoiceCreated'] = 3130783
        }
    },

    -----------------------------------------------------------
    -----------------------| UNIFORMS |------------------------
    -----------------------------------------------------------

    CitizenWear = {label = "Citizen Wear"},

    Uniforms = {
        {
            label = 'Mechanic Dress', -- Uniform Label
            jobs = {
                -- Job = job name, grades = grades
                {job = 'mechanic', grades = {0,1,2,3}},
                -- More jobs
            },
            male = {
                ['t-shirt'] = {item = 15, texture = 0},
                ['torso2'] = {item = 0, texture = 2},
                ['arms'] = {item = 0, texture = 0},
                ['pants'] = {item = 9, texture = 2},
                ['shoes'] = {item = 51, texture = 0},
                ['hat'] = {item = -1, texture = 0},
                ['accessory'] = {item = 0, texture = 0},
                ['ear'] = {item = -1, texture = 0},
                ['decals'] = {item = 0, texture = 0},
                ['mask'] = {item = 0, texture = 0}
            },
            female = {
                ['t-shirt'] = {item = 15, texture = 0},
                ['torso2'] = {item = 0, texture = 2},
                ['arms'] = {item = 0, texture = 2},
                ['pants'] = {item = 45, texture = 0},
                ['shoes'] = {item = 52, texture = 0},
                ['hat'] = {item = -1, texture = 0},
                ['accessory'] = {item = 0, texture = 0},
                ['ear'] = {item = -1, texture = 0},
                ['decals'] = {item = 0, texture = 0},
                ['mask'] = {item = 0, texture = 0}
            },
        },
    },
}
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(title, 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')
        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()
        end
    end
end

function InventoryOpenFunction(type, data)
    if type == 'society' then
        local job = data
        if Config.Inventory:lower() == 'ox_inventory' then
            exports.ox_inventory:openInventory('stash', 'society_'..data)
        elseif Config.Inventory:lower() == 'qb_inventory' then
            TriggerServerEvent("inventory:server:OpenInventory", "stash", "ambulancestash_"..QBCore.Functions.GetPlayerData().citizenid)
            TriggerEvent("inventory:client:SetCurrentStash", "ambulancestash_"..QBCore.Functions.GetPlayerData().citizenid)
        elseif Config.Inventory:lower() == 'quasar_inventory' then
            TriggerServerEvent("inventory:server:OpenInventory", "stash", "ambulancestash")
            TriggerEvent("inventory:client:SetCurrentStash", "ambulancestash")
        elseif Config.Inventory:lower() == 'chezza_inventory' then
            TriggerEvent('inventory:openStorage', "Locker", "locker", 100, 1000, {job})
        elseif Config.Inventory:lower() == 'core_inventory' then
            TriggerServerEvent('core_inventory:server:openInventory', job.."_locker", "big_storage", nil, nil)  
        end
    end
end

function ProgressBarFunction(time, text)
    if Config.ProgressBar:lower() == 'progressbars' then -- LINK: https://github.com/EthanPeacock/progressBars/releases/tag/1.0
        exports['progressBars']:startUI(time, text)
    elseif Config.ProgressBar:lower() == 'mythic_progbar' then -- LINK: https://github.com/HarryElSuzio/mythic_progbar
        TriggerEvent("mythic_progbar:client:progress", {name = "mechanicjobduty", duration = time, label = text, useWhileDead = false, canCancel = false})
    elseif Config.ProgressBar:lower() == 'pogressbar' then -- LINK: https://github.com/SWRP-PUBLIC/pogressBar
        exports['pogressBar']:drawBar(time, text)
    end
end

function ImpoundDeleteVehicle(vehicle)
    local plate = GetVehicleNumberPlateText(vehicle)
    DeleteEntity(vehicle)
end

function VehicleUnlock(vehicle)
    SetVehicleDoorsLocked(vehicle, 1)
	PlayVehicleDoorCloseSound(vehicle, 0)
end

function OpenCloakroomMenuEvent()
    TriggerEvent('qb-clothing:client:openOutfitMenu')
end

function CitizenWear()
    if Config['Core']:upper() == 'ESX' then
        Core.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin)
            TriggerEvent('skinchanger:loadSkin', skin)
        end)
    elseif Config['Core']:upper() == 'QBCORE' then
       TriggerEvent('qb-clothing:client:openOutfitMenu')
    end
end

function setUniform(uniformTable)
    if Config['Core']:upper() == 'ESX' then
        TriggerEvent('skinchanger:getSkin', function(skin)
            local uniform
            if skin.sex == 0 then
                uniform = uniformTable.male
            else
                uniform = uniformTable.female
            end

            local table = {}

            for k,v in pairs(uniform) do
                if k == 't-shirt' then
                    table.tshirt_1 = uniform['t-shirt'].item
                    table.tshirt_2 = uniform['t-shirt'].texture
                elseif k == 'torso2' then
                    table.torso_1 = uniform['torso2'].item
                    table.torso_2 = uniform['torso2'].texture
                elseif k == 'decals' then
                    table.decals_1 = uniform['decals'].item
                    table.decals_2 = uniform['decals'].texture
                elseif k == 'arms' then
                    table.arms = uniform['arms'].item
                elseif k == 'pants' then
                    table.pants_1 = uniform['pants'].item
                    table.pants_2 = uniform['pants'].texture
                elseif k == 'shoes' then
                    table.shoes_1 = uniform['shoes'].item
                    table.shoes_2 = uniform['shoes'].texture
                elseif k == 'hat' then
                    table.helmet_1 = uniform['hat'].item
                    table.helmet_2 = uniform['hat'].texture
                elseif k == 'accessory' then
                    table.chain_1 = uniform['accessory'].item
                    table.chain_2 = uniform['accessory'].texture
                elseif k == 'ear' then
                    table.ears_1 = uniform['ear'].item
                    table.ears_2 = uniform['ear'].texture
                elseif k == 'mask' then
                    table.mask_1 = uniform['mask'].item
                    table.mask_2 = uniform['mask'].texture
                end
            end

            TriggerEvent('skinchanger:loadClothes', skin, table)
        end)
    elseif Config['Core']:upper() == 'QBCORE' then
        local table = {}
        local gender = QBCore.Functions.GetPlayerData().charinfo.gender
        if gender == 0 then
            table.outfitData = uniformTable.male
        else
            table.outfitData = uniformTable.female
        end

        TriggerEvent('qb-clothing:client:loadOutfit', table)
    end
end

function DisableMinimap()
    DisplayRadar(false)
end

function EnableMinimap()
    DisplayRadar(true)
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 CloseMenuUtil()
    InCallsMenu = false
    
    Citizen.CreateThread(function()
        Citizen.Wait(1000)
        InMenu = false
    end)

    SetNuiFocus(false, false)

    DisplayRadar(true)
end

function GenerateAmbulancePlace()
    return string.sub(PlayerData.job.label, 1, 4)..''..math.random(0001, 9999)
end

-----------------------| UTILS TRIGGERS |-----------------------

RegisterNetEvent('brutal_mechanicjob:client:utils:CreateVehicle')
AddEventHandler('brutal_mechanicjob:client:utils:CreateVehicle', function(Vehicle)
    SetVehicleFuelLevel(Vehicle, 100.0)
    DecorSetFloat(Vehicle, "_FUEL_LEVEL", GetVehicleFuelLevel(Vehicle))

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

RegisterNetEvent('brutal_mechanicjob:client:utils:DeleteVehicle')
AddEventHandler('brutal_mechanicjob:client:utils:DeleteVehicle', function(Vehicle)

end)
server-utils.lua
ESX = Core
QBCore = Core

local YourWebhook = 'WEBHOOK-HERE'  -- help: https://docs.brutalscripts.com/site/others/discord-webhook

function GetWebhook()
    return YourWebhook
end

function ClearPlayerInventory(source)
    if Config.Inventory:lower() == 'ox_inventory' then
        exports.ox_inventory:ClearInventory(source)
    elseif Config.Inventory:lower() == 'quasar_inventory' then
        local saveItems = {
            'id_card', -- Add here the items that you do NOT want to be deleted
            'phone',
        }
        exports['qs-inventory']:ClearInventory(source, saveItems)
        local weapons = exports['qs-inventory']:GetWeaponList()
        for k,v in pairs(weapons) do
            RemoveItem(source, v.name, 1)
        end
    elseif Config.Inventory:lower() == 'qb_inventory' then
        exports['qb-inventory']:ClearInventory(source)
    elseif Config.Inventory:lower() == 'codem_inventory' then
        exports["codem-inventory"]:ClearInventory(source)
    elseif Config['Core']:upper() == 'ESX' then
        local xPlayer = ESX.GetPlayerFromId(source)
        for i=1, #xPlayer.inventory, 1 do
            if xPlayer.inventory[i].count > 0 then
                xPlayer.setInventoryItem(xPlayer.inventory[i].name, 0)
            end
        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 GetClosestPlayerFunction()
        return Core.Game.GetClosestPlayer()
    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:OnJobUpdate'
    TSCB = Core.Functions.TriggerCallback

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

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

    function GetClosestPlayerFunction()
        return Core.Functions.GetClosestPlayer()
    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
    onPlayerDeath = 'esx:onPlayerDeath'

    function GetIdentifier(source)
        local xPlayer = GETPFI(source)
        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 _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)
        local xPlayer = GETPFI(source)
        if _esx_ == 'new' then
            xPlayer.addInventoryItem(item, count)
        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)
        else
            local xPlayer = GETPFI(source)
            name = xPlayer.getName() or 'No Data'
        end
        return name
    end

    function GetPlayerSex(source)
        local xPlayer = GETPFI(source)
        return xPlayer.get("sex")
    end

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

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

    Core = exports['qb-core']:GetCoreObject()
    
    RESCB = Core.Functions.CreateCallback
    GETPFI = Core.Functions.GetPlayer
    RUI = Core.Functions.CreateUseableItem

    function GetIdentifier(source)
        local xPlayer = GETPFI(source)
        return xPlayer.PlayerData.citizenid
    end

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

    function GetPlayersFunction()
        return Core.Functions.GetPlayers()
    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 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 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 RemoveItem(source, item, amount)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.RemoveItem(item, amount)
    end

    function AddItem(source, item, count)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.AddItem(item, count)
    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 GetPlayerSex(source)
        local xPlayer = GETPFI(source)
        local sex = xPlayer.PlayerData.charinfo.gender

        if sex == 0 then
            sex = 'm'
        else
            sex = 'f'
        end

        return sex
    end

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

    function GetPlayerDeathMetaData(source)
        local xPlayer = GETPFI(source)
        return xPlayer.PlayerData.metadata['isdead']
    end

    function SetPlayerDeathMetaData(source, isDead)
        local xPlayer = GETPFI(source)
        xPlayer.Functions.SetMetaData("isdead", isDead)
    end

end

Last updated