# Add a new department

To add a new department, we will first add new data to the Department section. Here, I will add a new ambulance profession to show you.

```lua
    Departments = {
        [1] = {
            job = "police",
            label = "LSPD",
            type = "leo",
            defaultDuty = true,
            offDutyPay = false,
            name = "boss_1_pd_1", -- This should be the same as the boss menu name in the Coords section.
            grades = {
                ['0'] = { name = "Recruit", payment = 50 },
                ['1'] = { name = "Officer", payment = 75 },
                ['2'] = { name = "Sergeant", payment = 100 },
                ['3'] = { name = "Lieutenant", payment = 125 },
                ['4'] = { name = "Chief", isboss = true, payment = 150 },
            },
            blip = { label = "LSPD", coords = vector3(430.931885, -981.019775, 30.69519), sprite = 60, color = 38, scale = 0.9, shortRange = true }
        },
        [2] = {
            job = "ambulance",
            label = "Ambulance",
            type = "medical",
            defaultDuty = true,
            offDutyPay = false,
            name = "new_job_ambulance", -- This should be the same as the boss menu name in the Coords section.
            grades = {
                ['0'] = { name = "EMT Recruit", payment = 50 },
                ['1'] = { name = "EMT", payment = 75 },
                ['2'] = { name = "Paramedic", payment = 100 },
                ['3'] = { name = "Doctor", payment = 125 },
                ['4'] = { name = "Chief Doctor", isboss = true, payment = 150 },
            },
            blip = {
                label = "Ambulance",
                coords = vector3(-449.2, 6012.9, 31.7),
                sprite = 60,
                color = 5,
                scale = 0.9,
                shortRange = true
            }
        },
    },

```

Then let's add the weapon part.

```lua
    Items = {
        armory_pd_1 = {
            { id = "body_cam", name = "Bodycam", category = "utility", grade = 0, price = 10.00, image = "bodycam.png", desc = "A body camera used by police officers.", itemName = "body_cam", stack = 1, maxPerCart = 1 },
            { id = "bodycam_dashboard", name = "Bodycam Dashboard", category = "utility", grade = 1, price = 10.00, image = "bodycam_dashboard.png", desc = "Dashboard to view bodycams.", itemName = "bodycam_dashboard", stack = 1, maxPerCart = 1 },
            { id = "dispatch_tablet", name = "Dispatch Tablet", category = "utility", grade = 2, price = 10.00, image = "dispatch_tablet.png", desc = "Dispatch control tablet.", itemName = "dispatch_tablet", stack = 1, maxPerCart = 1 },
        .......
        },
        new_job_ambulance = {
            { id = "pistol",   name = "Pistol",   category = "weapons", grade = 0, price = 10.00, image = "",    desc = "Sidearm.", itemName = "weapon_pistol", stack = 1, maxPerCart = 1 },
            -- You can add different items for different armories if needed
        },

    },
```

As you can see, the name section below and the key in the Items section are the same. This is how it should be.

```lua
        Armory = {
            {
                name = "armory_pd_1",
                coords = vector4(452.3751, -980.8171, 30.6896, 280.0136),
                jobs = { "police" },
                distance = 1.5,
                icon = "fas fa-warehouse",
                marker = { enabled = false, type = 1, scale = 0.6, z = 0.5, color = { r = 0, g = 180, b = 255, a = 180 } },
                npc = { enabled = false, model = `s_m_y_cop_01`, z = 0.0, heading = 90.0 }
            },
            {
                name = "new_job_ambulance",
                coords = vector4(825.9536, -1290.8199, 28.2406, 349.9286),
                jobs = { "ambulance" },
                distance = 1.5,
                icon = "fas fa-warehouse",
                marker = { enabled = false, type = 1, scale = 0.6, z = 0.5, color = { r = 0, g = 180, b = 255, a = 180 } },
                npc = { enabled = false, model = `s_m_y_cop_01`, z = 0.0, heading = 90.0 }
            },
        },
```

Now let's add a different clothing location

```lua
        Clothes = {
            {
                name = "clothes_pd_1",
                coords = vector4(454.4904, -989.3156, 30.6896, 3.9650),
                jobs = { "police" },
                distance = 2.0,
                icon = "fas fa-tshirt",
                marker = { enabled = false, type = 1, scale = 0.6, z = 0.5, color = { r = 180, g = 255, b = 180, a = 180 } },
                npc = { enabled = false, model = `s_m_y_cop_01`, z = 0.0, heading = 270.0 }
            },
            { --  Cloths = { section, don't forget to add clothes for the new job. Whatever you wrote as the name here should also be the title there. 
                name = "new_job_ambulance",
                coords = vector4(456.8773, -989.3724, 30.6896, 216.8990),
                jobs = { "ambulance" },
                distance = 2.0,
                icon = "fas fa-tshirt",
                marker = { enabled = false, type = 1, scale = 0.6, z = 0.5, color = { r = 180, g = 255, b = 180, a = 180 } },
                npc = { enabled = false, model = `s_m_y_cop_01`, z = 0.0, heading = 270.0 }
            }
        },
```

Here, the key in the Cloths section is the same as the name. This should always be the case.

```lua
    Cloths = {
        clothes_pd_1 = {
            male = {
                [1] = {
                    outfitLabel = 'Short Sleeve',
                    outfitData = {
                        pants     = { item = 24, texture = 0, defaultItem = 0, defaultTexture = 0 },
                        arms      = { item = 19, texture = 0, defaultItem = 0, defaultTexture = 0 },
                    },
                }, ...................
        },

        --You can add the clothes you want as shown above according to your preference.
        new_job_ambulance = {
            male = {},
            female = {}
        },

    },
```

Now let's add a new garage. The logic is always the same. Don't forget to enter the same name.

```lua
        Garage = {
            {
                name = "garage_pd_1",
                coords = vector4(451.2826, -1015.2921, 28.4720, 96.8340),
                jobs = { "police" },
                spawnCoords = vector4(439.9452, -1019.5364, 28.7177, 93.5490),
                distance = 3.0,
                icon = "fas fa-car",
                marker = { enabled = false, type = 36, scale = 0.9, z = 0.5, color = { r = 255, g = 120, b = 120, a = 180 } },
                npc = { enabled = false, model = `s_m_y_cop_01`, z = 0.0, heading = 180.0 }
            },
            {
                name = "new_job_ambulance",
                coords = vector4(444.8105, -1015.2521, 28.5985, 256.4282),
                jobs = { "ambulance" },
                spawnCoords = vector4(447.6108, -1024.0791, 28.6043, 210.7899),
                distance = 3.0,
                icon = "fas fa-car",
                marker = { enabled = false, type = 36, scale = 0.9, z = 0.5, color = { r = 255, g = 120, b = 120, a = 180 } },
                npc = { enabled = false, model = `s_m_y_cop_01`, z = 0.0, heading = 180.0 }
            },
        },
        
```

```lua
    Garage = {
        garage_pd_1 = {
            ["police"]   = { label = "Patrol Buffalo", ranks = {1,2}, livery = 1, price = 10, customimg = "" },
            ["police2"]  = { label = "Interceptor",    ranks = {1,2}, livery = 1, price = 10, customimg = "" },
            ["police3"]  = { label = "Marked Charger", ranks = {2,3}, livery = 1, price = 10, customimg = "" },
            ["police4"]  = { label = "Marked CVPI",    ranks = {2,3}, livery = 1, price = 10, customimg = "" },
            ["policeb"]  = { label = "Police Bike",    ranks = {3,4}, livery = 1, price = 10, customimg = "" },
            ["policet"]  = { label = "Transport Van",  ranks = {3,4}, livery = 1, price = nil, customimg = "" },
            ["riot"]     = { label = "Riot Van",       ranks = {4},   livery = 0, price = nil, customimg = "" },
        },

        new_job_ambulance = {
            ["sahp1"] = { label = "SAHP Cruiser", ranks = {1,2}, livery = 0, price = 10 },
            ["sahp2"] = { label = "SAHP Charger", ranks = {2,3}, livery = 1, price = 10 },
        },

    },

```

Now let's add the boss menu. The name here should be the same as the name in the Departments section, just like the others.

```lua
      BossMenu = {
            {
                name = "boss_1_pd_1", -- Boss menu name should be the same as the department name in the Departments section.
                coords = vector4(447.9785, -973.3724, 30.6896, 171.2821),
                jobs = { "police" },
                distance = 2.0,
                icon = "fas fa-crown",
                marker = { enabled = false, type = 25, scale = 0.6, z = 0.5, color = { r = 200, g = 120, b = 255, a = 180 } },
                npc = { enabled = false, model = `s_m_y_cop_01`, z = 0.0, heading = 45.0 }
            },
            
            {
                name = "new_job_ambulance", -- Boss menu name should be the same as the department name in the Departments section.
                coords = vector4(450.7745, -975.2523, 30.6896, 143.7883),
                jobs = { "ambulance" },
                distance = 2.0,
                icon = "fas fa-crown",
                marker = { enabled = false, type = 25, scale = 0.6, z = 0.5, color = { r = 200, g = 120, b = 255, a = 180 } },
                npc = { enabled = false, model = `s_m_y_cop_01`, z = 0.0, heading = 45.0 }
            },
        },
```

<mark style="color:$danger;">**SQL OPERATIONS**</mark> (*If you do not perform these steps, the job you added will not work properly.)*

First, add the job you just added to the grades section in the order shown in the photo. Don't forget to select the boss. Sample code:

```sql
INSERT INTO frkn_pd_job_grades (id, job_name, grade, label, payment, is_boss) VALUES
(7,  'ambulance', 0, 'RecruitRecruit', 50, 0),
(8,  'ambulance', 1, 'Paramedic',      75, 0),
(9,  'ambulance', 2, 'Doctor',         100, 0),
(10, 'ambulance', 3, 'Surgeon',        125, 0),
(11, 'ambulance', 4, 'Chief',          150, 1);
```

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2Ff1e2tNT2ngf8RLGqy5Dp%2Fimage.png?alt=media&#x26;token=8b117eec-bc4d-4645-9674-5c62748da0e6" alt=""><figcaption></figcaption></figure>

You should also add the necessary items here later to configure permissions. Adding them in order will suffice. Example for Ambulance Job:

```sql
INSERT INTO qbcore_25daa7.frkn_pd_job_grade_perms 
(id, job_grade_id, can_hire, can_promote, can_view_balance, can_withdraw, can_manage_evidence, can_read_report) VALUES
(7,  6, 0, 1, 0, 0, 0, 0),
(8,  7, 1, 1, 1, 1, 1, 1),
(9,  8, 0, 1, 0, 0, 0, 0),
(10, 9, 1, 1, 1, 1, 1, 1),
(11,10, 1, 1, 1, 1, 1, 1);

```

<figure><img src="https://3505378470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmOhVROw9E3kpmAG3JYVe%2Fuploads%2FeW967LLyAWTIdgGhEvse%2Fimage.png?alt=media&#x26;token=dac9d27e-02f1-44ef-ae08-37698f4e00df" alt=""><figcaption></figcaption></figure>
