# Welcome!

### Please choose which script you require help with on the left tab!

{% hint style="info" %}
Join <https://discord.gg/2MupXQMSWR> if you need further support
{% endhint %}


# About this script

## Information

This is my first PAID release on the forums, and a project I have spent countless hours on reworking and trying to perfect it. It’s gone over a few “remakes” before now finally reacing a state where I feel comfortable enough to release it to the public. Its been tested and used for a while but of course issues may still arise, so please report any issues or improvements and I will make sure to fix them.

**Player ran dealerships! Add as many dealerships you want, with option to showcase vehicles and have limited amount of vehicles being purchasable.**

{% hint style="warning" %}
*As stated below, this is made for ESX first and foremost. However I have made it functional on QBCore running the very basics.*
{% endhint %}

## Requirements

{% tabs %}
{% tab title="ESX" %}
ESX (version shouldn’t matter)

ESX Society + Job setup

esx\_vehicleshop is required
{% endtab %}

{% tab title="QBCore" %}
**QBCore is for most parts untested and not highly supported! This script is natively made for ESX and ported to QBCore**

QBCore (oxmysql)

For business functionality in QBCore you will have to edit the `server/main.lua` and setup it up to fully work with QBCore (Currently it will use the players bank money)
{% endtab %}
{% endtabs %}

{% hint style="danger" %}
Do not change the name of the resource if you do not know how to edit the rest of the files
{% endhint %}


# Installation

1. Drag and Drop `doughDealership` into your resources folder
2. Add `ensure doughDealership` to your server.cfg
3. Import `sql/import.sql` to your DB

{% hint style="info" %}

For ESX → requires a table named owned\_vehicles ( esx\_vehicleshop )

For QBCore → requires player\_Vehicles ( qb-vehicleshop | sql files is included in sql folder as well)

{% endhint %}

### Change from ESX -> QBCore

1. Script is by default set to use ESX, if you wish to change it to use QBCore edit `shared/config.lua` and set `Config.ESX = false`
2. Go into `fxmanifest.lua` and comment out the marked sections


# Additional Settings

### Adding your first (and additional) dealership(s)

* Go into `shared/config.lua` and change the default (“vehicleshop”) details into correct ones
* Most items should be explained within the config itself

```
{ -- DEALERSHIP 1
        name = 'vehicleshop', -- KEEP THIS THE SAME AS THE MAIN JOB ACCESSING THE DEALERSHIP! THIS IS THE SOCIETY & JOB REQUIRED
        label = 'Vehicleshop', -- DEALERSHIP LABEL USED EVERYWHERE WHERE A LABEL IS NEEDED (BLIP ETC.)
        coords = vector3(547.2, -182.06, 54.49), -- COORDS FOR DEALERSHIP MENU + MAP BLIP
        spawn = {coords = vector3(548.4, -198.29, 54.49), heading = 180.0}, -- COORDS WHERE VEHICLE WILL SPAWN WHEN SOLD TO ANOTHER PLAYERR
        showcaseVehicles = { -- SHOWCASE SPOTS (SHOULD SUPPORT A INFINITE AMOUNT! UI WILL PROBABLY BECOME MESSED UP WITH TO MANY, KEEP IT BELOW 6)
            {id = 1, coords = vector3(547.45, -190.61, 54.49), heading = 63.0, model = nil, vehicle = nil}, -- ID = INCREMENTAL VALUE || COORDS = VEHICLE SHOWCASE SPOT || HEADING = VEHICLE HEADING || MODEL = LEAVE THIS NIL || VEHICLE = LEAVE THIS NIL
            {id = 2, coords = vector3(547.9481, -175.6810, 54.0807), heading = 139.0, model = nil, vehicle = nil},
            {id = 3, coords = vector3(544.2737, -181.7314, 54.0809), heading = 33.0, model = nil, vehicle = nil},
            {id = 4, coords = vector3(545.9059, -168.8376, 54.0813), heading = 71.0, model = nil, vehicle = nil},
        },
    },
```

{% hint style="info" %}
See Above as 1 dealership-block, if you wish to add another dealership you simply copy-paste the whole block {}
{% endhint %}

```
{ -- DEALERSHIP 1
        name = 'vehicleshop', -- KEEP THIS THE SAME AS THE MAIN JOB ACCESSING THE DEALERSHIP! THIS IS THE SOCIETY & JOB REQUIRED
        label = 'Vehicleshop', -- DEALERSHIP LABEL USED EVERYWHERE WHERE A LABEL IS NEEDED (BLIP ETC.)
        coords = vector3(547.2, -182.06, 54.49), -- COORDS FOR DEALERSHIP MENU + MAP BLIP
        spawn = {coords = vector3(548.4, -198.29, 54.49), heading = 180.0}, -- COORDS WHERE VEHICLE WILL SPAWN WHEN SOLD TO ANOTHER PLAYERR
        showcaseVehicles = { -- SHOWCASE SPOTS (SHOULD SUPPORT A INFINITE AMOUNT! UI WILL PROBABLY BECOME MESSED UP WITH TO MANY, KEEP IT BELOW 6)
            {id = 1, coords = vector3(547.45, -190.61, 54.49), heading = 63.0, model = nil, vehicle = nil}, -- ID = INCREMENTAL VALUE || COORDS = VEHICLE SHOWCASE SPOT || HEADING = VEHICLE HEADING || MODEL = LEAVE THIS NIL || VEHICLE = LEAVE THIS NIL
            {id = 2, coords = vector3(547.9481, -175.6810, 54.0807), heading = 139.0, model = nil, vehicle = nil},
            {id = 3, coords = vector3(544.2737, -181.7314, 54.0809), heading = 33.0, model = nil, vehicle = nil},
            {id = 4, coords = vector3(545.9059, -168.8376, 54.0813), heading = 71.0, model = nil, vehicle = nil},
        },
},

{ -- DEALERSHIP 2
        name = 'vehicleshop', -- KEEP THIS THE SAME AS THE MAIN JOB ACCESSING THE DEALERSHIP! THIS IS THE SOCIETY & JOB REQUIRED
        label = 'Vehicleshop', -- DEALERSHIP LABEL USED EVERYWHERE WHERE A LABEL IS NEEDED (BLIP ETC.)
        coords = vector3(547.2, -182.06, 54.49), -- COORDS FOR DEALERSHIP MENU + MAP BLIP
        spawn = {coords = vector3(548.4, -198.29, 54.49), heading = 180.0}, -- COORDS WHERE VEHICLE WILL SPAWN WHEN SOLD TO ANOTHER PLAYERR
        showcaseVehicles = { -- SHOWCASE SPOTS (SHOULD SUPPORT A INFINITE AMOUNT! UI WILL PROBABLY BECOME MESSED UP WITH TO MANY, KEEP IT BELOW 6)
            {id = 1, coords = vector3(547.45, -190.61, 54.49), heading = 63.0, model = nil, vehicle = nil}, -- ID = INCREMENTAL VALUE || COORDS = VEHICLE SHOWCASE SPOT || HEADING = VEHICLE HEADING || MODEL = LEAVE THIS NIL || VEHICLE = LEAVE THIS NIL
            {id = 2, coords = vector3(547.9481, -175.6810, 54.0807), heading = 139.0, model = nil, vehicle = nil},
            {id = 3, coords = vector3(544.2737, -181.7314, 54.0809), heading = 33.0, model = nil, vehicle = nil},
            {id = 4, coords = vector3(545.9059, -168.8376, 54.0813), heading = 71.0, model = nil, vehicle = nil},
        },
},
```

{% hint style="info" %}
Each dealership you add will require their own society + job setup to function with receiving money
{% endhint %}

* In `dealership_vehicles` create a new entry

```
INSERT INTO `dealership_vehicles` (`dealership`, `data`) VALUES ('vehicleshop', '[]');
```

* In `dealership_shop` you will need to add all vehicles accessible to the shop with their model, name (label), price, category and how many there is available

```
INSERT INTO `dealership_shop` (`dealerships`, `model`, `name`, `price`, `category`, `available`) VALUES ('[{\"name\":\"vehicleshop\"}]', 'adder', 'Adder Label', 1000, 'standard', 100);
```

{% hint style="info" %}
If you wish to make a car accessible to more than 1 dealership, simply change the `dealerships` in `dealership_shop` for that specific vehicle, and update the `[{"name":"vehicleshop"}]` into `[{"name":"vehicleshop"}, {"name":"vehicleshop2"}]`
{% endhint %}


# Using the in-game menu

* When you first access the menu in-game your `vehicles` tab will be empty. Simply go into the `store` tab and select a category from the dropdown, and press Buy Vehicle!
* The vehicles that are owned by the dealership are all available under the `vehicles` tab. Here you can sell the vehicle to the closest player, or put it on showcase (using any of the numbers)
* If you are the boss of the dealership you will see the option `settings` In here you can both update prices, and change the label for a vehicle your dealership owns!
* The `refresh` button will simply refresh the vehicles out on showcase! Vehicles that are spawned onto the showcase are only spawned for the people currently on the server, so it might be a good idea to refresh them from time to time if there is a lot of people joining / leaving to showcase them for everyone!
* Do keep in mind that adding more showcase spots will not only make the Ui cluttered, but can also cause performance issues for clients passing by the dealership


# About this script

## Information

Simple Ui-based script for players to change name (firstname + lastname)

## Requirements

* ESX (mysql-async) or QBCore (oxmysql)
* Do not change the name of the resource if you do not know how to edit the rest of the files


# Installation

1. Drag and Drop `doughNamechanger` into your resources folder
2. Add `ensure doughNamechanger` to your server.cfg

### Change from QBCore -> ESX

1. Script is by default set to use QBCore, if you wish to change it to use ESX edit `shared/config.lua` and set `Config.ESX = true`
2. Go into `fxmanifest.lua` and comment out the `@qb-core/import.lua` and uncomment the 3 files in `server_scripts {}`

### Use BT-Target

1. Uncomment the lines in `fxmanifest.lua` that are marked
2. Change `Config.UseBTtarget = true`
3. Success! Should work now!

{% hint style="info" %}
Credit for BT-Target goes to [https://forum.cfx.re/u/skellykat\_gaming/](https://forum.cfx.re/u/skellykat_gaming/summary)
{% endhint %}


# About this script

## Requirements

* ESX (mysql-async)
* Do not change the name of the resource if you do not know how to edit the rest of the files


# Installation

Following files will need to be edited for the script to function in a ideal way!

* `server/config.lua`
* `shared/config.lua`
* `client/config.lua`
* `html/public/config.js`


# Settings

### shared/config.lua

#### Config.Locations

```lua
['uniqueName'] = {
    location = vec3(758.86, -719.73, 28.15),
    label = 'Grove Street Storage',
    types = {
      {type = 'small', rentPrice = 1500, buyPrice = 50000},
      {type = 'medium', rentPrice = 5000, buyPrice = 50000},
    },
  },
```

`uniqueName` = this value can be any word combined with numbers (city1, legionStorage) but has to be unique!

`types` will define which storage types are available at the location. These types have to be defined under `Config.UnitSettings` as well

#### Config.UnitSettings

```lua
Config.UnitSettings = {
  ['small'] = {
    type = 'small',
    size = 5000,
    label = 'small storage unit',
    image = 'https://dough.land/u/Bb7I6zISP5.png'
  },

  ['medium'] = {
    type = 'medium',
    size = 10000,
    label = 'medium storage unit',
    image = 'https://dough.land/u/SEoD6q00o7.png'
  },

  ['large'] = {
    type = 'large',
    size = 20000,
    label = 'large storage unit',
    image = 'https://dough.land/u/iSVP5tTLD2.png'
  },
}
```

Feel free to add more types (`small / medium / large`) following the same format

Size is only used in inventories that support a max weight

{% hint style="info" %}
***Untested***, but in inventories that limit by slots you should be able to set this to slots instead
{% endhint %}

### client/config.lua

{% hint style="warning" %}
This area of the guide will be improved over time. This resource has been developed using a single inventory but should be usable with all inventories with minor modifications.
{% endhint %}

{% tabs %}
{% tab title="doughStorage:client:openInventory" %}
Change contents to fit your inventory needs! This was developed using [Chezza's Inventory](https://chezza.tebex.io/package/4770357) but should work with any inventory without any issues.

```lua
-- Available data

data.id --storage unit unique identifier (from database)

details.identifier  --same as above
details.owner       --playerowner identifier
details.location    --storage unit location (from shared/config.lua)
details.type        --storage unit type (from shared/config.lua)
details.isrented    --true / false
details.price       --price that unit was either bought at / rented for

Config.Locations[details.location].label --gets label for storage facility
Config.Locations[details.location].location --gets location for storage facility

Config.UnitSettings[details.type].size --gets unit max weight / slots
Config.UnitSettings[details.type].label --gets units specific label
```

{% hint style="info" %}
Use `Config.UnitSettings[details.type].size` and set it to a slot limit in the config for inventories that use slots instead of weight
{% endhint %}
{% endtab %}

{% tab title="doughStorage:client:raidInventory" %}
Change contents to fit your inventory needs! This was developed using [Chezza's Inventory](https://chezza.tebex.io/package/4770357) but should work with any inventory without any issues.

```lua
-- Available data

data.id --storage unit unique identifier (from database)

details.identifier  --same as above
details.owner       --playerowner identifier
details.location    --storage unit location (from shared/config.lua)
details.type        --storage unit type (from shared/config.lua)
details.isrented    --true / false
details.price       --price that unit was either bought at / rented for

Config.Locations[details.location].label --gets label for storage facility
Config.Locations[details.location].location --gets location for storage facility

Config.UnitSettings[details.type].size --gets unit max weight / slots
Config.UnitSettings[details.type].label --gets units specific label
```

{% hint style="info" %}
Use `Config.UnitSettings[details.type].size` and set it to a slot limit in the config for inventories that use slots instead of weight
{% endhint %}
{% endtab %}
{% endtabs %}


# Installation

## blip-manager

#### For blips that should change on job switch, for instance the regular job-center jobs use the below

```lua
TriggerEvent('doughJobmanager:client:registerBlip', {
    unique = JOBNAME, -- for the automatic switch, this has to be the jobname
    label = LABEL, -- this can be anything, label for the UI
    job = true, -- if this is a job, true.. else remove line or false
    state = false, -- enable the blip by default? leave false for these jobs
    blipData = {
        coords = BLIPCOORDS, -- coords for the specific blip (v.blipCoords..)
        sprite = BLIPSPRITE, -- sprite for the specific blip (v.blipSprite..)
        scale = 0.65, -- scale for the specific blip (v.blipScale..)
        colour = BLIPCOLOUR, -- colour for the specific blip (v.blipColour..)
        blipLabel = BLIPLABEL -- label for the specific blip (v.blipLabel..)
    }
})
```

{% hint style="info" %}
All data inside `blipData` should be unique to each blip you want to register for the job
{% endhint %}

{% hint style="warning" %}
This is only a example of how to use the event!&#x20;
{% endhint %}

```lua
Citizen.CreateThread(function()
    for k,v in pairs(Jobs) do 
        for i=1, #v.location, 1 do  
            TriggerEvent('doughJobmanager:client:registerBlip', {
                unique = v.jobName,
                label = k,
                job = true,
                state = false,
                blipData = {
                    coords = v.location[i].coords,
                    sprite = v.location[i].blip.sprite,
                    scale = 0.65,
                    colour = v.location[i].blip.color,
                    blipLabel = v.location[i].blip.blipName
                }
            })
        end
    end
end)
```

#### For all "regular" blips that should be availble to everyone, all the time:

```lua
TriggerEvent('doughJobmanager:client:registerBlip', {
    unique = 'garages', -- unique name for all blips in this "category"
    label = 'Garage Blips', -- label for the UI
    single = false, -- is there only 1 blip with this unique?
    state = false, -- enable the blip by default?
    blipData = {
        coords = v.coords,
        sprite = Config.Blip[v.Type].sprite,
        scale = 0.65,
        colour = Config.Blip[v.Type].colour,
        blipLabel = 'Garage Blips'
    }
})
```

## menu-triggers

#### This script comes with no triggers to open the menus. You will need to trigger them yourself

```lua
-- CLIENT EVENTS
TriggerEvent('doughJobmanager:client:blipmanager')
TriggerEvent('doughJobmanager:client:jobcenter')
TriggerEvent('doughJobmanager:client:bossmenu')
```

## other-settings

#### Inside of `client/public.lua` there are various other edits you can make to fit your specific needs. Change how notifications work, add jobcenters, and there are premade commands and examples on how to use the functions

#### By default the blipmanager is accessed by a command `blipmanager`. To disable this comment out `client/public.lua 75:77`

{% hint style="warning" %}
All the in-UI notifications are permanent and **CANNOT** be edited.&#x20;
{% endhint %}


