> For the complete documentation index, see [llms.txt](https://docs.kojascripts.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kojascripts.eu/new/cardealer/configuration/creating-a-cardealer.md).

# Creating a Cardealer

{% code title="Config.lua" %}

```lua
KOJA.Zones = {
    {
        name = "Luxury", -- Name of the vehicles list
        title = 'Car Dealer', -- Title visible in the ui
        desc = 'Example description', -- Description visible in the ui
        permissions = { 
            enable = false, -- Whether permissions are enabled for this zone
            groups = {} -- List of groups that have access (if permissions are enabled)
        },
        blip = {
            name = 'Car Dealer', -- Name displayed on the blip info text
            coords = vec3(-56.6436, -1098.7725, 26.4223), -- Coordinates of the blip on the map
            sprite = 147, -- Blip icon sprite ID
            colour = 26, -- Color ID of the blip
            scale = 0.8, -- Scale of the blip
            visible = true, -- Whether the blip is visible on the map
        },
        ped = {
            pedName = "Mark", -- Name of the ped (displayed above head)
            pedHash = 0x2930C1AB, -- Hash of the ped model
            pedCoord = vector3(-56.6436, -1098.7725, 26.4223 - 0.99), -- Coordinates where the ped will spawn
            pedHeading = 19.5501, -- Heading of the ped
            drawText = "[E] - Open Car Dealer", -- Text displayed when near the ped
            drawDistance = 20, -- Distance within which the text is visible
            drawTextTarget = 'Open Car Dealer' -- Action text in the target menu when looked at. (Only if KOJA.Target is enable)
        },
        vehicleSpawn = {
            coords = vector3(-44.8656, -1097.4705, 26.4223 - 0.99), -- Coordinates where test vehicle will spawn
            heading = 100.0, -- Heading of the spawned vehicle
        },
        vehicleBuySpawn = {
            coords = vec3(-13.1227, -1099.2169, 26.6721), -- Coordinates where purchased vehicle will spawn
            heading = 160.0 -- Heading of the purchased vehicle
        }
    },
}

```

{% endcode %}

Create a vehicles list and link it to the **name** section of the zone

```lua
KOJA.CarDealer = {
    ["Luxury"] = { 
        Categories = { 
            ["Sports"] = { 
                Cars = {
                    {name = "Sultan", brand = 'Obey', model = "sultan", price = 250000, rating = 900},
                    {name = "Sultan RS", brand = 'Obey', model = "sultanrs", price = 250000, rating = 900},
                    {name = "Elegy RH8", brand = 'Annis', model = "elegy", price = 200000, rating = 850},
                    {name = "9F Cabrio", brand = 'Übermacht', model = "ninef", price = 500000, rating = 900},
                    {name = "Omagio", brand = 'Declasse', model = "omnis", price = 500000, rating = 910},
                    {name = "Adder", brand = 'Truffade', model = "adder", price = 1500000, rating = 920},
                }
            },
        
            ["Muscle"] = {
                Cars = {
                    {name = "Dominator", brand = 'Vapid', model = "dominator", price = 320000, rating = 850},
                    {name = "Slamvan", brand = 'Chevrolet', model = "slamvan", price = 450000, rating = 800},
                    {name = "Ruiner", brand = 'Imponte', model = "ruiner", price = 300000, rating = 870},
                    {name = "Yosemite", brand = 'Declasse', model = "yosemite", price = 400000, rating = 840},
                    {name = "Phoenix", brand = 'Imponte', model = "phoenix", price = 370000, rating = 860},
                }
            },
        }
    },
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kojascripts.eu/new/cardealer/configuration/creating-a-cardealer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
