# Installation

{% hint style="warning" %}
Make sure you read everything carefull when installing this resource.
{% endhint %}

## Dependencies

[Polyzone](https://github.com/mkafrin/PolyZone) by mkafrin\
[qb-core](https://github.com/qbcore-framework/qb-core) by qbcore-framework\
[qb-target](https://github.com/qbcore-framework/qb-target) by qbcore-framework or [ox\_target](https://github.com/overextended/ox_target/releases) by Overextended\
[qb-menu](https://github.com/qbcore-framework/qb-menu) by qbcore-framework or [ox\_lib's context menu](https://github.com/overextended/ox_lib/releases) by Overextended\
[ps-ui](https://github.com/Project-Sloth/ps-ui) by Project-Sloth (optional)\
[tasks](https://github.com/Thummie/thommie-tasks/) by thommie (optional)

## How to install

* Download and unzip the thommie-weapondealer.zip
* Add "ensure thommie-weapondealer" to your server.cfg
* (re)start your server and you are done.

## How to add new locations

You can create new locations for the vehicle to spawn very easy, you go to your config.lua and you will search for Config.Locations (line 25 by default). Now you can follow the template we have made and change the values. (*To have the perfect timing with the waits you need to test some values*)

#### Locations Template:

```lua
['ID'] = {
    spawn = vector3(0, 0, 0), -- This is the location where the helicopter will spawn
    land = vector3(0, 0, 0), -- This is the location where the helicopter will land
    despawn = vector3(0, 0, 0), -- This is the location where the helicopter will despawn
    area = { -- Create an area with polyzone, this is necessary for (de)spawning the NPC's and vehicles
        minz = 0.0,
        maxz = 0.0,
        zone = {
            vector2(0.0),
            vector2(0.0),
            vector2(0.0),
            vector2(0.0),
        },
    },
    wait = { -- The wait time is time in seconds
        first = 10, -- The time the script waits until it changes the speed of the helicopter
        second = 10, -- The time the script waits until the helicopter is starting to land.
        third = 30, -- The time the script waits for the helicopter to be land and then let the weapondealers step out of the helicopter.
    },
}
```

## How to add new weapon loadouts

You can create new weapon loadouts by going to the config.lua and search for Config.Weapons (line 48 by default). Now you can follow the template we have made and change the values to what you want.

#### Weapons Template:

```lua
['ID'] = {
    ['WEAPON_ONE'] = {
        name = 'weapon_one',
        label = 'Weapon One',
        available = true, -- Options: true & false (If false you can not buy this weapon)
        amount = 2,
        maxStock = 2, -- The mamimum amount of weapons that will be available
        restock = 1, -- How many of this weapon will be restocked after resetting the stock.
        price = 19500,
    },
    ['WEAPON_TWO'] = {
        name = 'weapon_two',
        label = 'Weapon Two',
        available = true,
        amount = 1,
        maxStock = 1,
        restock = 1,
        price = 120000,
    },
},
```


---

# Agent Instructions: 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.thummie.com/docs/premium/weapondealer/installation.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.
