# Dealer

## Overview

* Our Prison Dealer system allows inmates to exchange items within the prison using a currency called `"cigarette."`
* This creates an internal economy that can be managed and utilized by the inmates. The configuration path for this system is located at: `data/presets/yourMap.lua/`.

### Config file structure for Dealer

* Each dealer position is uniquely configured for each map preset and is part of the interaction system.
* Below is an example of the configuration structure:

```lua
{
    coords = vec3(1631.953, 2527.754, 45.564),
    type = INTERACT_TYPES.DEALER,
    zone = {
        size = vec3(1, 1, 1),
        icon = "fa-solid fa-paper-plane",
        label = _U('TARGET_ZONE.DEALER_LABEL'),
        distance = 1.0
    },
    npc = {
        coords = vec3(1631.953, 2527.754, 45.564),
        heading = 51.067,
        model = 's_m_y_prismuscl_01'
    },
    blip = {
        state = Config.RenderNPCBlips,
        name = _U('BLIPS.DEALER'),
        sprite = 155,
        scale = 1.0,
        color = 0,
    },
    items = {
        {
            name = "WEAPON_KNIFE",
            label = _U('ITEM_LABELS.KNIFE'),
            price = 40,
        },
        {
            name = "ecola",
            price = 8,
        },
        {
            name = "donut",
            price = 5,
        },
        {
            name = "wire_cutter",
            label = _U('ITEM_LABELS.WIRE_CUTTER'),
            price = 30,
        }
    },
    access = INTERACT_ACCESS_TYPES.PRISONER_ONLY
},
```

## Gallery

<figure><img src="https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-bde284ab3a3bfce659cd72df177f4ec466104d2a%2Fprison_dealer_interact.png?alt=media" alt=""><figcaption><p>Interaction with Dealer</p></figcaption></figure>

<figure><img src="https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-2b925a12dd3ed8a6391520a53919b4982f7429b4%2Fprison_dealer_offer.png?alt=media" alt=""><figcaption><p>Dealer offer</p></figcaption></figure>

## Features

* Provide items for Prisoner that can be exchanged through economy item `cigarette` \[can be adjusted in: Config.EconomyItem (config.lua)]

## Location

* By default can be found under blip named `Prison dealer` with icon/symbol (WEAPON)
* The location can be different for each map preset and can be adjusted in `rcore_prison/data/presets/yourPrisonMap.lua`.

<figure><img src="https://1037498771-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MZErcztD5BvrKnwRGJq%2Fuploads%2Fgit-blob-8a1f6896634649cffc3294ac599aa164863d3a0d%2Fprison_dealer_location.png?alt=media" alt=""><figcaption><p>Location of Dealer</p></figcaption></figure>
