# QBCore

## Installation

{% hint style="warning" %}
Please buy the script only on <https://store.ayk-script.com> if you find the script elsewhere, it's a scam! Once you have purchased the script download it only via keymaster
{% endhint %}

{% hint style="danger" %}
Please note that if you have no knowledge of development, please follow all the steps without skipping them, and if you have any questions, don't hesitate to open a ticket!
{% endhint %}

{% hint style="info" %}
Welcome to the Ayk-Rental installation guide

Please follow all installation steps and apply them correctly. We hope the documentation will be easy to use for everyone! If after following all the instructions you still can't launch the script correctly, you can open a ticket.
{% endhint %}

***

## Guide Line

### Fisrt

*First download the asset via keymaster*

{% hint style="warning" %}
Be sure to download the latest version!
{% endhint %}

***

### Secondly

*Drop script in server resources and ensure file in server.cfg*

{% hint style="info" %}
Be sure to unzip the file
{% endhint %}

***

### Thirdly

Make sure you have dependent scripts

**Asset dependencies :**&#x20;

* QBCore or ESX
* QBCore or ox\_lib
* QB-Inventory or Ox-Inventory

***

## QB-Inventory

Put the following item in qb-core/shared/item.lua

```lua
rental_contract                      = { name = 'rental_contract', label = 'Rental Contract', weight = 0, type = 'item', image = 'rental_contract.png', unique = true, useable = true, shouldClose = false, description = 'Information Details for the vehicle you rented' },
```

After selecting the add image item, an image is displayed in INSTALLATION / IMAGE... You take it and put it in qb-inventory/html/images

<figure><img src="/files/Lx1ij9uotYzuX8l9IB7U" alt=""><figcaption></figcaption></figure>

## QS-Inventory

Go to qs-inventory/config/metadata.js and then add this : <br>

```javascript
        } else if (itemData.name == "rental_contract") {
            $(".item-info-title").html("<p>" + label + "</p>");
            $(".item-info-description").html(
                "<p><strong>Plate: </strong><span>" +
                (itemData.info.numberplate || "Unknown") +
                "</span></p><p><strong>Rented By: </strong><span>" +
                (itemData.info.rentedby || "Unknown") +
                "</span></p><p><strong>Date: </strong><span>" +
                (itemData.info.day || "Unknown") +
                "</span> at <span>" +
                (itemData.info.time || "Unknown") +
                "</span></p>"
            );
```

Add the item as above in qb-core/shared/item.lua

```lua
rental_contract                      = { name = 'rental_contract', label = 'Rental Contract', weight = 0, type = 'item', image = 'rental_contract.png', unique = true, useable = true, shouldClose = false, description = 'Information Details for the vehicle you rented' },
```

After selecting the add image item, an image is displayed in INSTALLATION / IMAGE... You take it and put it in qs-inventory/html/images

<figure><img src="/files/Lx1ij9uotYzuX8l9IB7U" alt=""><figcaption></figcaption></figure>

***

### QBCore Config :&#x20;

```lua
Config.Framework = 'qb-core'                                   -- Which Framework qb-core or esx
Config.DrawTextCore = 'qb'                                     -- Which draw text are you using qb or ox
Config.Keys = 'qb-keys'                                        -- Which KeySystem are you using qb-keys or custom if you have a custom keys system (you can add the export below in the config)
Config.FuelFolderName = 'LegacyFuel'                           -- Which Fuel System are you using ?
Config.Inventory = 'qb-inventory'                              -- Which Inventory are you using ? ox-inventory or qb-inventory
Config.menu = 'qb-menu'                                        -- Which menu are you using ? ox_lib or qb-menu
Config.Notify = 'inbuilt'                                      -- Which notif are you using ? ox, qb or inbuilt (our notif system built in this script)
Config.Money = 'bank'                                          -- Can be cash or bank
Config.Target = {
    usingTarget = false,                                       -- Using target or no
    targetSyst = 'qb-target',                                  -- Which target system are you using ? ox_target or qb-target
}

Config.TimerOutCustom = false                                  -- Use the Custom Money Removal if the player doesn't return the vehicle
Config.TimerOutCustomDeduction = 50                            -- How much money should get deducted if the player is using the custom money removal in every 5 minutes(Configurable in RentTimer)
Config.TimerOutDeduction = 2                                   -- this is the divided money for example if the vehicle was rented at 100 dollars then 50 dollars would get deducted in short, the money is getting divided by 2
Config.RentTimer = 5000                                        -- 1 second is 1000, This is the timer after how many seconds the money should gets removed currently it's 5 mins.
Config.DestroyPenalty = 2000                                   -- How much Money should be deducted from the player if they destroy the vehicle?
Config.WarpVehicle = false                                     -- Put Player to vehicle after the player takes rent?
Config.NumberPlate = "RNT"                                     -- Starting 3 digit the number plate should have
Config.ContractItem = 'rental_contract'                        -- This is the item as a proof that the Player has rented the vehicle, as it would be containing details like vehicle number plate / rented by / rented on
Config.FuelOnSpawn = 100                                       -- How much fuel should be there on the car when it gets rented
Config.PenaltyCharge = 60                                      -- if the vehicle is reported stolen this would multiply the amount of money at which the car was rented so for example if it was 1 multiplying it with 60 it would be 60
Config.RentItemDelete = true                                   -- If you want the contract to be deleted when the vehicle is returned or reported
```


---

# 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://ayk-script.gitbook.io/ayk-script-docs/installation-assets/ayk-rental/installation/qbcore.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.
