# Adding Shops

{% hint style="danger" %}
IMPORTANT INFORMATION
{% endhint %}

* The **key** (shop name) must match the **`shopType`** args you pass in the info table

```lua
['My Cool Shop'] = { -- the key is the shop name
    info = {
        shopLabel = 'My Cool Shop', -- label used as the shop header
        targetIcon = 'fa-solid fa-hand-point-up', -- icon used for target interaction
        targetLabel = 'Open Shop', -- label used for target interaction
        distance = 2.0, -- max distance for target interaction
        scenario = 'WORLD_HUMAN_CLIPBOARD', -- name of scenario used set to nil for nothing
        args = { shopType = "My Cool Shop" }, -- args sends the shopType data to the event to determine which inventory shop to open and displays the relevant products available - this must be the same as the key name
    },
    blips = { -- blip settings for shop
        enabled = true, -- blip enabled
        id = 52, -- blip id
        colour = 2, -- blip colour
        scale = 0.6, -- bliip scale
        title = 'My Cool Shop', -- blip title
    },
    models = { -- define random ped models below
        'mp_m_securoguard_01',
    },
    locations = { -- define spawn locations for the vendor must be vector4
        vector4(1777.59, 2560.52, 45.62, 187.83),
    },
    inventory = {
        -- define items and their prices below that can be purchased at this particular vendor - ensure these are in your items.lua!
        { name = 'my_cool_item',     price = 4, amount = 50 },
        { name = 'my_cool_item_that_requires_a_job',   price = 0, amount = 1,  requiresJob = {'police', 'bsco', 'leo',}, },
        { name = 'my_cool_item_that_requires_a_job_&_rank',         price = 0, amount = 50, requiresJob = {'police', 'bsco', 'leo',}, requiresRank = 1, },
        { name = 'my_cool_item_that_requires_a_license',         price = 0, amount = 50, requiresLicense = 'weapon', },
    },
},
```

***

{% hint style="warning" %}
Info
{% endhint %}

* shopLabel  is the label displayed in the shop menu header
* targetIcon is the icon used when targeting the ped
* targetLabel is the label displayed when targeting the ped
* distance is the maximum distance permitted to target the ped make sure this is below the number you set in Config.CoreSettings.Security.maxDistance to prevent clashes with the security checks and cause unnecessary issues
* scenario is the scenario animation used for the ped (set to nil for no animation)
* args sends the shopType data which determines the inventory this must match the key name of the shop

```lua
info = {
    shopLabel = 'My Cool Shop', -- label used as the shop header when opening the inventory shop
    targetIcon = 'fa-solid fa-hand-point-up', -- icon used for target interaction
    targetLabel = 'Open Shop', -- label used for target interaction
    distance = 2.0, -- max distance for target interaction
    scenario = 'WORLD_HUMAN_CLIPBOARD', -- scenario used for ped
    args = { shopType = "My Cool Shop" }, -- args sends the shopType data to the event to determine which inventory shop to open and displays the relevant products available - this must be the same as the key name
},
```

***

{% hint style="warning" %}
Blips
{% endhint %}

Blip information can be found here: <https://docs.fivem.net/docs/game-references/blips/>

* enable specific blips by setting 'enabled' to true
* id is the id of the blip you want to be displayed for that shop
* colour is the id of the colour you want to be displayed for that shop
* scale is the size of the blip on your map
* title is the name of the blip on your map&#x20;

```lua
blips = { -- blip settings for shop
    enabled = true, -- blip enabled
    id = 52, -- blip id
    colour = 2, -- blip colour
    scale = 0.6, -- bliip scale
    title = 'Supermarket', -- blip title
},
```

***

{% hint style="warning" %}
Models
{% endhint %}

Ped models can be found here: <https://docs.fivem.net/docs/game-references/ped-models/>

* You can use a single ped model or you can use multiple
* if using multiple peds it will randomly pick a ped for each store from the models you define

```lua
models = { -- define random ped models below
    'mp_m_shopkeep_01',
    'a_m_y_beachvesp_01',
},
```

***

{% hint style="warning" %}
Locations
{% endhint %}

* You can set multiple locations or single ones for each shop
* The locations must be a vector4 to function correctly

```lua
locations = { -- define spawn locations for the vendor must be vector4
    vector4(24.47, -1346.62, 29.5, 271.66),
    vector4(-3039.54, 584.38, 7.91, 17.27),
    vector4(-3242.97, 1000.01, 12.83, 357.57),
    vector4(1728.07, 6415.63, 35.04, 242.95),
    vector4(1959.82, 3740.48, 32.34, 301.57),
    vector4(549.13, 2670.85, 42.16, 99.39),
    vector4(2677.47, 3279.76, 55.24, 335.08),
    vector4(2556.66, 380.84, 108.62, 356.67),
    vector4(372.66, 326.98, 103.57, 253.73),
},
```

***

{% hint style="warning" %}
Inventory
{% endhint %}

* Here you can define what items can be purchased at this particular shop
* You can also add restrictions to items which is covered in more detail below
* name is the item name - ensure this is in your items.lua!
* price is the cost of that particular item
* amount is the maximum amount players can purchase at once
* for weapons it is advised to only stock 1 of that item to ensure there is no issues with serial number generation from your inventory script

```lua
inventory = { 
    -- define items and their prices below that can be purchased at this particular vendor - ensure these are in your items.lua!
    { name = 'tosti',         price = 2,   amount = 50 },
    { name = 'water_bottle',  price = 2,   amount = 50 },
    { name = 'kurkakola',     price = 2,   amount = 50 },
    { name = 'twerks_candy',  price = 2,   amount = 50 },
    { name = 'snikkel_candy', price = 2,   amount = 50 },
    { name = 'sandwich',      price = 2,   amount = 50 },
    { name = 'lighter',       price = 2,   amount = 50 },
},
```

***

{% hint style="warning" %}
Restrictions
{% endhint %}

* You can set restrictions for job, job rank and license for items
* To set  job requirements you can use a table of jobs allowing multiple jobs to access that shop or you can use a single string allowing just a single job to access that shop

{% hint style="success" %}

```
requiresJob = {'my_cool_job_name', 'my_other_cool_job_name', },


requiresJob = 'my_cool_job_name',
```

{% endhint %}

```lua
{ name = 'weapon_nightstick',   price = 0, amount = 1,  requiresJob = {'police', 'bsco', 'leo',}, },
```

***

* You can set job rank restrictions for certain items, the police armory is a good example of this for things such as higher powered weaponry, this could be rank locked to higher level police officers&#x20;
* You can not pass just the job rank on its own, you must also define the jobs that can access the store in the first place using  requiresJob

{% hint style="success" %}

```
requiresRank = 1,
```

{% endhint %}

```lua
{ name = 'pistol_ammo',         price = 0, amount = 50, requiresJob = {'police', 'bsco', 'leo',}, requiresRank = 1, },
```

***

* You can set license restrictions for items such as weapons that require a 'weapons' license just make sure your license type you set is a valid license in your server and is able to be granted to players

{% hint style="success" %}

```
requiresLicense = 'my_cool_license_name',
```

{% endhint %}

```lua
{ name = 'pistol_ammo',         price = 0, amount = 50, requiresLicense = 'weapon', },
```


---

# 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://lusty94-scripts.gitbook.io/documentation/free/shops/adding-shops.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.
