# How to add a vehicle with a new category

## In game editor

Video

{% embed url="<https://www.youtube.com/watch?v=Ul60s827piM>" %}

## Creating shop for new job + bossmenu + displayed vehicles

Video

{% embed url="<https://www.youtube.com/watch?v=8VLlab_UAfU>" %}

## How to add a vehicle with a new category (manual way)

We can add a new category in a database for the shop which will be in a table called `categories_vehicles`

![](https://rco.re/docs/pdm/new-cat-19.png)

So we're going create a new category for job `dealer` we need to first lookup whats the highest order for the job `dealer` which is 11 at the moment, so if we're going to create the category the next order will be 12, but watch out if we do not want to extend the category for `dealer` but for example `boatdealer` the highest order for this job is 2 so the next one will be 3. It always goes from the highest from the current job we're editing!

\
So let's create for example `test` category for job `dealer`

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-9bc0528a164276027e2303d30214d6dca0bd5ea5%2Fimage%20\(4\).png?alt=media\&token=1a5845b5-0b8b-461d-b846-25e3b141c521)

the `model` must be an existing model in the game because it's the display model for the category, so our `test` the category will have a display model of a police car.

Now we created the category `test`, we will have to head to a table called `vehicles_to_buy`

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-1ebee7ae289e677a2392c2e8c2f84cff13464466%2Fimage%20\(8\).png?alt=media\&token=4df36742-049a-47dc-a8e7-2c3c8b7175cf)

Here we're going to just copy whatever row we want

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-43026a2e35a94a0af2cc09283e5a1b8698b6d292%2Fimage%20\(6\).png?alt=media)

Here we're going to change the model to any model we want to sell in the certain category we just made, ours is `police`

And a little down below we can see `category` so we're going to change that one to the `name` of the category we just created. Do not put "label" from the category in there it won't work.

Now we will need to edit config so go to the rcore\_pdm/config/pdm\_shops.lua

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-7c2555d288259cd21a9170f4637f2a9474121427%2Fimage%20\(9\).png?alt=media\&token=f1f55b5d-e18e-41de-9ba4-bacf1018084c)

We're going to find CategoriesAllowed and just add the `test` category in there.

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-a3b6332879e7cec7fd82f9510147962fc49f67cb%2Fimage%20\(7\).png?alt=media\&token=fb1887ce-9c3e-4f36-a81a-8bd208757c14)

And if we did everything correctly it will show up in-game like this

![](https://rco.re/docs/pdm/new-cat-52.png)

![](https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-b107794e5bc70e70ce301b1510ece50312ac4436%2Fimage%20\(1\).png?alt=media\&token=bce1c537-3d39-4d9c-bb09-98f8777ade04)

## Creating new shop in config file

All existing vehicle shops can be found in the directory: `rcore_pdm/config/pdm_shops.lua`

The blip on minimap can be added here

{% content-ref url="blips-on-minimap" %}
[blips-on-minimap](https://documentation.rcore.cz/paid-resources/rcore_pdm/blips-on-minimap)
{% endcontent-ref %}

```lua
Config.ShopList = {
    -- This is a key and it must be uniq name
    ["example_shop"] = {
        -- what type it is?
        Type = "car",

        -- do not change
        Busy = false,

        -- shall we enable 3D text?
        Enable3DText = true,

        -- What text will the 3D text have?
        FloatText = "🛵\n\n   bikes + motobikes",

        -- a custom enter message
        CustomEnterMessage = "Hit ~INPUT_CONTEXT~ to view the bike shop!",

        -- Marker position with interactive menu
        Position = vector3(-51.9, -1100.71, 26.42),

        -- Marker style
        MarkerSpawnerStyle = {
            style = 37,
            size = vector3(1.0, 1.0, 1.0),
            color = { r = 247, g = 113, b = 104, a = 125 },
            rotate = true,
            face = false,
        },

        -- This will select only certain vehicles, if left nil everything will break.
        Job = "dealer",

        -- Society name
        Society = "society_dealer",

        -- Where vehicle will spawn?
        SpawnPoints = PDMSpawn,

        -- This will lock the marker to be visible and functional for only one job
        -- RenderJob = "dealer",

        -- Custom message for marker enter
        --CustomEnterMessage = "Damn a custom message!",

        -- What vehicles will be blocked in this particual shop?
        --BlockedVehiclesToTestDrive = {
            --GetHashKey("sultan"),
        --},

        -- What vehicles will be whitelisted in this particual shop?
        --WhitelistedVehiclesToTestDrive = {
            --GetHashKey("sultan"),
        --},

        -- this will block every vehicle in the category
        --BlockedVehiclesToDriveCategories = {
            --"motorcycles", "super"
        --},

        -- This will block categories with name "motorcycles" and "super", the rest will be displayed.
        --BlackListedCategories = {
            --"motorcycles", "super"
        --},

        -- This will only allow to display category "motorcycles" nothing else will be displayed
        CategoriesAllowed = {
            "motorcycles",
        },

        -- A custom camera position?
        CameraPositions = {
            -- same ID's like from "Config.CameraPosition"
            ["car"] = PDMCamera,
        },
    },
}
```
