# :truck: Car shop delivery
Documentation relating to the kd_carshop

:::: tabs
::: tab BUY
[Buy the script](https://jumpon-studios.com/fivem/car-delivery)
:::

::: tab PREVIEW
<iframe width="560" height="315" src="https://www.youtube.com/embed/s9H4rvXFCgI?si=-fbB2TWaTklhIugh" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
:::
::::

## 1. Installation
kd_carshop is a standalone script. So you don't need a specific framework to use it. It's also mean it works with all framework (Esx, QBCore, VRP, DRP, …).

- Drag and drop the resource in your resources folder
  - kd_carshop
- Add this ensure in your server.cfg
  - `ensure kd_carshop``
- Congratulation, the Car Shop Delivery script is ready to be use !
## 2. Usage
Start the job with the client event
```lua
TriggerEvent('StartFarmConcess')

```
You can also use the command. This command can be remove in the config.lua file.
```lua
/farm
```
## 3. Config.lua
The configuration file is `config.lua` in the resource root. **Do not edit this file directly** as your changes may be lost during updates. Instead, use `overwriteConfig.lua` to store your customizations.

- **`config.lua`** - Default configuration maintained by developers. **Do not modify this file.**
- **`overwriteConfig.lua`** - This is where you place only the values you want to override.

### How to customize the configuration

1. Open `kd_carshop/overwriteConfig.lua`
2. Find the value you want to change in `config.lua` (e.g., `Config.language`)
3. Copy only that line into `overwriteConfig.lua`
4. Edit the copied value to your liking

The script loads `config.lua` first, then `overwriteConfig.lua` overwrites only the values you redefine. This ensures your customizations are preserved when updating the script.

`kd_carshop/config.lua`

```lua
-- Price for 1km
PrixKilometre = 90

Base = {
  VehSpawn = {
      vector4(144.262,-3108.514,4.896,90.0),
      vector4(132.541,-3102.325,4.896,93.338),
      vector4(133.361,-3108.286,4.896,94.641)
  },
  PedSpawn = vector4(132.913,-3112.457,4.896,355.428),
  PedPortModel = `s_m_y_dwservice_02`,
  models = {'Brioso','Issi2','F620','Oracle2','Sentinel2','Zion2','Blade','Dominator','Hotknife','Faction2','SabreGT2','Picador','Tampa','Virgo2','Bifta','Mesa2','Baller','Cavalcade2','Gresley','Dubsta2','Rocoto','Serrano',
    'Asterope','Intruder','Emperor','Fugitive','Stratum','Washington','Banshee','Comet2','Coquette','Fusilade','Infernus2','Massacro','Khamelion','RapidGT2','Tropos',
    'Seven70','BType3','Coquette3','Stinger','Monroe','Stinger','Casco','Monroe','Surano','Lynx','Omnis','Alpha','Premier'
  },
  pedmodels = {'a_f_m_ktown_01','a_f_o_ktown_01','a_f_y_bevhills_02','a_f_y_eastsa_03','a_f_y_hipster_01','a_f_y_vinewood_01','a_f_y_vinewood_03',
    'a_m_m_genfat_02','a_m_m_mexlabor_01','a_m_m_skidrow_01','a_m_m_stlat_02','a_m_y_bevhills_01','a_m_y_epsilon_01','a_m_y_genstreet_01','a_m_y_ktown_01','a_m_y_mexthug_01','a_m_y_polynesian_01',
    'a_m_y_stwhi_01','a_m_y_vinewood_02','a_m_y_vinewood_03','a_m_y_vinewood_04','a_m_y_yoga_01','cs_debra','cs_fabien','cs_patricia','cs_paper','cs_prolsec_02','cs_taocheng','csb_anita','csb_chin_goon','csb_dix','csb_fos_rep','csb_hao','csb_sol','csb_reporter','csb_tonya','csb_vagspeak','g_f_importexport_01','g_m_m_armlieut_01','g_m_m_mexboss_02','g_m_y_korlieut_01',
    'g_m_y_korean_01','g_m_y_salvagoon_02','mp_f_boatstaff_01','mp_g_m_pros_01','mp_m_execpa_01'
  },
  livraison = {
      {ped=vector4(-863.477,-1094.633,1.163,342.562),park=vector4(-864.455,-1090.372,1.162,297.686)},
      {park = vector4(-950.781,-899.574,1.163,298.061),ped = vector4(-949.808,-905.098,1.159,302.413)},
      {park = vector4(-921.903,-952.036,1.162,297.394),ped = vector4(-926.291,-948.876,1.242,297.55)},
      {park = vector4(-1081.52,-1046.714,1.149,299.316),ped = vector4(-1075.785,-1045.896,1.15,62.177)},
      {park = vector4(-1037.133,-1008.812,1.15,127.858),ped = vector4(-1043.463,-1010.013,1.15,223.298)},
      {park = vector4(-1027.796,-1513.596,4.594,210.641),ped = vector4(-1015.454,-1514.472,5.514,131.5)},
      {park = vector4(-1086.176,-1499.449,3.99,305.625),ped = vector4(-1086.975,-1502.207,3.978,36.145)},
      {park = vector4(-1273.04,-609.72,25.729,220.758),ped = vector4(-1278.755,-607.718,25.086,238.066)},
      {park = vector4(-1563.674,-295.564,47.275,234.328),ped = vector4(-1564.517,-300.301,47.232,312.273)},
      {park = vector4(-1937.821,362.048,92.68,155.237),ped = vector4(-1931.33,362.546,92.969,96.803)},
      {park = vector4(-1412.56,559.536,123.62,270.526),ped = vector4(-1404.506,561.498,124.406,128.756)},
      {park = vector4(-526.594,528.681,110.956,44.005),ped = vector4(-527.036,517.613,111.94,42.098)},
      {park = vector4(-575.197,496.67,105.555,8.231),ped = vector4(-580.537,492.853,107.831,13.342)},
      {park = vector4(76.677,-29.147,67.657,342.465),ped = vector4(72.031,-31.518,67.811,338.397)},
      {park = vector4(239.709,26.916,82.664,342.039),ped = vector4(246.572,29.289,83.127,70.309)},
      {park = vector4(858.071,-521.327,56.298,228.439),ped = vector4(853.767,-516.529,56.328,223.237)},
      {park = vector4(875.532,-596.282,57.133,312.454),ped = vector4(875.911,-601.98,57.442,43.442)},
      {park = vector4(1308.029,-534.656,70.312,160.364),ped = vector4(1303.256,-527.552,70.46,156.522)},
  },
  duree_chargement = 2000,
}

function GiveItem(plate)
    --Add your function to give the key item to player here
end

function LookCar(veh)
    -- Lock the car when it spawn
    -- SetVehicleDoorsLockedForAllPlayers(veh, true)
end

function RemoveItem(plate)
    --Add your function to remove the key item to player here
end

function CheckIfUserHaveKey(plate)
    local HaveKey = true
    --Add your function to check if user have the key here
    return HaveKey
end

function GiveMoney(price, vehicle)
    --Add your function to give money to user here
end

RegisterNetEvent("StartFarmConcess")
AddEventHandler("StartFarmConcess", function()
    StartFarmConcess()
end)

RegisterCommand('farm', function()
    StartFarmConcess()
end)
```

`kd_carshop/lang.lua`

```lua
Lang = {}

Lang['already_start'] = "A mission is already in progress"
Lang['call'] = "Importer's call in progress"
Lang['name_importer'] = "Import-Export"
Lang['fail_call'] = "Hello~n~~g~~r~No vehicles are available at this time"
Lang['mission'] = "Carshop mission"
Lang['success_call'] = "Hello~n~The customer's vehicle is available at the depot.~n~Come see me"
Lang['ask_key'] = "~h~Come see me to get the vehicle keys."
Lang['key'] = "~h~Here are the keys.~n~Take care of it."
Lang['gps'] = "~h~I have added the delivery location to your GPS.~n~Happy day."
Lang['drop'] = "~h~Hello,~n~You can let the car in front of my house."
Lang['thanks'] = "~h~Thank you very much."
Lang['thanks_key'] = "~h~Thanks for the keys.~n~Good day."
Lang['lost_key'] = "~h~I can't pay you because you lost my keys."
Lang['forget_key'] = "~h~I think you forgot to give me the keys to the vehicle.~n~Can you come back?"
```
