How to add a vehicle with a new category

In game editor

Video

Creating shop for new job + bossmenu + displayed vehicles

Video

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

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

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

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

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

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

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

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

pageBlips on minimap
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,
        },
    },
}

Last updated