# HRGarages

## Preview

<div><figure><img src="/files/CiZSPqUYSc8Kmt9TBuI8" alt=""><figcaption></figcaption></figure> <figure><img src="/files/QrhKzXC01W09CGtk6oWN" alt=""><figcaption></figcaption></figure> <figure><img src="/files/QgazGDXRMbJu5VmDt9Bz" alt=""><figcaption></figcaption></figure></div>

{% embed url="<https://youtube.com/watch?v=TvvyiP2t51M>" %}

## Purchase

You can purchase HRGarages from our [webstore](https://hrscripts.tebex.io) and also join our [discord](https://discord.gg/m268SrJZTb) server to follow for discounts

## Dependencies

* [HRLib](/hrscripts-documentation/resources/hrlib.md)
* [oxmysql](https://overextended.dev/oxmysql)
* [ESX Legacy](https://documentation.esx-framework.org/legacy/installation)/[QBCore](https://docs.qbcore.org/qbcore-documentation/qb-core/core-object) framework

## Installation

* Purchase [HRGarages](https://hrscripts.tebex.io/category/escrowed/) from our tebex store and move the script in your resources folder
* Download the [dependencies](#dependencies)
* Configure HRLib, oxmysql and the framework for your needs
* HRGarages is pre-configured script but you'll need to have a look through its config files, found in `HRGarages/config/` folder
* Add this to your `server.cfg` <br>

  ```
  start oxmysql
  start HRLib
  start framework # es_extended or "qb-core"
  start HRGarages
  ```
* Restart your server and enjoy the script

## Config

HRGarages config is separated in couple files for better definition of the script's features configs.\
You can find these files in `HRGarages/config/` folder.\
Very important to know is when you have custom cars, you have to add your own images for the cars in the rent-a-car feature if any of them is with custom model. You can do this by putting `.webp` images in `HRGarages/config/customImages/` folder.

{% tabs %}
{% tab title="commands.lua" %}

```lua
local config <const> = {}

config.commands = {
    enable = true,
    commandsSettings = {
        giveVehicle = {
            enable = true,
            isRestricted = true,
            name = 'giveVehicle',
            description = 'Give vehicle to player',
            suggestions = {
                {
                    name = 'playerId',
                    help = 'Target player server Id'
                },
                {
                    name = 'vehicleModel',
                    help = 'The vehicle model (spawn code)'
                },
                {
                    name = 'vehiclePlate',
                    help = 'The vehicle\'s plate, must be 8 characters long, not more or less (not necessary, default - random plate)'
                },
                {
                    name = 'garageIndex',
                    help = 'The garage where to put the vehicle in (not necessary, default - random garage)'
                }
            }
        },
        removeVehicle = { -- Remove vehicle from garage
            enable = true,
            isRestricted = true,
            name = 'removeVehicle',
            description = 'Remove vehicle from someone\'s garage',
            suggestions = {
                {
                    name = 'vehiclePlate',
                    help = 'The target vehicle\'s plate'
                }
            }
        }
    }
}
```

{% endtab %}

{% tab title="impoundGarages.lua" %}

```lua
local config <const> = {}

config.impoundGarages = {
    impoundFee = 500,
    feeAccount = 'bank',
    blipSettings = {
        blipLabel = 'Наказателен Паркинг',
        blipSprite = 50,
        blipScale = 0.8,
        blipColor = 1,
        blipDisplay = 2
    },
    garagesCoords = {
        { -- The positions are the positions of davispd's impound
            pedPosition = vector4(407.3775, -1624.6903, 29.2919, 229.4537),
            spawnCoords = {
                vector4(419.4937, -1629.6766, 28.7694, 141.8549),
                vector4(416.9567, -1627.7761, 28.7691, 140.8800),
                vector4(420.7558, -1635.7812, 28.7695, 90.0989),
                vector4(420.2980, -1638.9332, 28.7694, 89.4561),
                vector4(420.0670, -1641.9648, 28.7682, 90.4215),
                vector4(417.9238, -1645.8817, 28.7692, 50.1330),
                vector4(409.5179, -1639.7175, 28.7694, 50.1143),
                vector4(411.7224, -1637.4547, 28.7677, 49.5121),
                vector4(410.9884, -1656.1366, 28.7684, 320.7554),
                vector4(408.5130, -1654.0081, 28.7674, 320.4073),
                vector4(406.2133, -1651.8816, 28.7680, 321.2579),
                vector4(403.6921, -1650.1006, 28.7698, 319.3674),
                vector4(401.2584, -1647.9384, 28.7686, 321.0678),
                vector4(398.8898, -1645.9050, 28.7681, 320.1758),
                vector4(396.4982, -1643.9979, 28.7678, 319.6743)
            },
        },
        {
            pedPosition = vector4(-997.5369, -2609.1375, 34.1051, 61.4905),
            spawnCoords = {
                vector4(-1036.0671, -2594.7007, 33.6415, 239.7062),
                vector4(-1041.9172, -2604.7439, 34.7515, 239.8721),
                vector4(-1041.9172, -2604.7439, 34.7515, 239.8721),
                vector4(-1043.8073, -2607.8970, 35.2286, 239.8059),
                vector4(-1045.6228, -2611.1833, 35.6566, 242.0721),
                vector4(-1047.4730, -2614.4690, 35.9615, 240.4093),
                vector4(-1049.4044, -2617.7058, 36.0810, 240.4273),
                vector4(-1051.3844, -2621.1892, 36.0819, 238.7776),
                vector4(-1053.3983, -2624.7075, 36.0808, 239.7022),
                vector4(-1055.1411, -2627.9231, 36.0809, 240.7404),
                vector4(-1050.9165, -2634.1196, 36.0807, 330.4901),
                vector4(-1045.8861, -2636.8496, 36.0816, 331.4610),
                vector4(-1042.6552, -2638.9565, 36.0816, 329.7005),
                vector4(-1039.1205, -2640.5459, 36.0813, 329.0218),
                vector4(-1036.0254, -2642.4661, 36.0815, 329.2130),
                vector4(-1032.8802, -2644.4602, 36.0807, 330.1822),
                vector4(-1027.5354, -2647.1790, 36.0808, 329.9557),
                vector4(-1020.0037, -2648.1252, 36.0807, 59.1351),
                vector4(-1017.9937, -2645.0789, 36.0802, 59.2972),
                vector4(-1016.4663, -2641.2429, 36.0812, 60.2956),
                vector4(-1014.5867, -2637.9485, 36.0804, 61.3253),
                vector4(-1012.6148, -2634.7622, 35.9692, 59.9850),
                vector4(-1010.6698, -2631.4111, 35.6602, 59.4836),
                vector4(-1008.7834, -2628.1858, 35.2374, 60.3894),
                vector4(-1007.1145, -2624.9565, 34.7649, 59.8900),
                vector4(-1005.0043, -2621.5977, 34.2634, 59.6823),
                vector4(-990.3429, -2596.3906, 34.2909, 59.7864),
                vector4(-988.6157, -2593.0942, 34.7629, 59.1846),
                vector4(-986.8103, -2589.9231, 35.2353, 59.6966),
                vector4(-984.6647, -2586.6897, 35.6740, 59.7913),
                vector4(-983.0892, -2583.2856, 35.9689, 60.2164),
                vector4(-981.1096, -2580.1484, 36.0817, 61.1329),
                vector4(-979.1969, -2576.8584, 36.0813, 60.7341),
                vector4(-977.2566, -2573.2073, 36.0814, 60.6374),
                vector4(-975.1840, -2570.1863, 36.0806, 60.1721),
                vector4(-979.5862, -2564.1074, 36.0814, 150.6615),
                vector4(-984.6801, -2561.2854, 36.0803, 150.1661),
                vector4(-988.0023, -2559.4822, 36.0808, 150.6355),
                vector4(-991.0923, -2557.3784, 36.0819, 149.6764),
                vector4(-994.3614, -2555.3557, 36.0806, 150.0310),
                vector4(-997.5494, -2553.7366, 36.0804, 150.0156),
                vector4(-1010.4410, -2549.7795, 36.0813, 239.5906),
                vector4(-1012.2613, -2553.1436, 36.0803, 239.5801),
                vector4(-1013.7484, -2556.6387, 36.0806, 240.5843),
                vector4(-1015.9405, -2560.0564, 36.0814, 241.2577),
                vector4(-1017.8153, -2563.3386, 35.9638, 238.7151),
                vector4(-1019.6935, -2566.4441, 35.6764, 240.0490),
                vector4(-1021.4668, -2569.7725, 35.2512, 239.9813),
                vector4(-1023.5087, -2573.1062, 34.7443, 240.8344),
                vector4(-1029.4121, -2583.2139, 33.6442, 240.5854),
                vector4(-1032.8279, -2587.5667, 33.5808, 149.9727),
                vector4(-1026.3269, -2631.1487, 36.0819, 60.3608),
                vector4(-1024.6825, -2627.9026, 36.1887, 61.8188),
                vector4(-1022.7653, -2624.3979, 36.5100, 61.4683),
                vector4(-1020.8685, -2621.1584, 36.9404, 61.1954),
                vector4(-1018.7793, -2617.7974, 37.4556, 59.8752),
                vector4(-1017.1857, -2614.5049, 37.9135, 61.4325),
                vector4(-1015.4185, -2611.3396, 38.2855, 62.0851),
                vector4(-1013.4188, -2607.7563, 38.5135, 59.8955),
                vector4(-1011.1500, -2603.8184, 38.5812, 61.7686),
                vector4(-1008.8450, -2600.1765, 38.5809, 60.5307),
                vector4(-1006.8692, -2596.5051, 38.5249, 60.3360),
                vector4(-1004.6511, -2592.7224, 38.2919, 58.7827),
                vector4(-1002.6298, -2589.6340, 37.9152, 60.2502),
                vector4(-1001.0703, -2586.1936, 37.4431, 60.1256),
                vector4(-998.9055, -2582.9937, 36.9406, 56.9936),
                vector4(-997.0244, -2579.6938, 36.5058, 57.2840),
                vector4(-995.3116, -2576.2146, 36.1944, 59.0174),
                vector4(-993.0876, -2573.2109, 36.0807, 60.6300),
                vector4(-1003.7957, -2567.1321, 36.0827, 239.0772),
                vector4(-1005.5946, -2570.4246, 36.2016, 240.0495),
                vector4(-1007.3491, -2573.5938, 36.4941, 242.8657),
                vector4(-1009.3415, -2576.9468, 36.9389, 241.6693),
                vector4(-1009.3415, -2576.9468, 36.9389, 241.6693),
                vector4(-1013.2113, -2583.4050, 37.9021, 241.9596),
                vector4(-1015.2641, -2586.6960, 38.2993, 240.7301),
                vector4(-1017.1455, -2590.1094, 38.5125, 242.2208),
                vector4(-1024.6184, -2601.6292, 38.5058, 239.7758),
                vector4(-1025.5967, -2605.3992, 38.2896, 239.7485),
                vector4(-1027.7299, -2608.4958, 37.9054, 237.1125),
                vector4(-1029.4259, -2611.9224, 37.4243, 239.3226),
                vector4(-1031.4971, -2615.0906, 36.9329, 237.0353),
                vector4(-1033.2600, -2618.4114, 36.5051, 238.1352),
                vector4(-1034.9653, -2621.7273, 36.2016, 239.4849),
                vector4(-1037.1334, -2624.9343, 36.0816, 238.6463),
            },
        },
    }
}
```

{% endtab %}

{% tab title="jobGarages.lua" %}

```lua
local config <const> = {}

config.jobGarages = {
    blip = {
        scale = 0.8,
        displayId = 2,
        asShortRange = true,
    },
    garagesPositions = {
        {
            blipLabel = 'LSPD Garage',
            blipSprite = 830,
            blipColor = 3,
            includeImpoundGarage = true,
            jobs = {
                'police'
            },
            vehiclesList = {
                { vehicle = 'police', minGrade = 2 },
                { vehicle = 'police2', minGrade = 2 },
                { vehicle = 'police3', minGrade = 2 },
                { vehicle = 'police4', minGrade = 2 },
                { vehicle = 'police5', minGrade = 2 },
            },
            coords = {
                impoundBlipWaypointCoords = vector2(425.1, -979.5), -- It only matters to enter its value when includeImpoundGarage is true, it answers to the position of the waypoint when a player wants to see where its impounded vehicle is while its vehicle is in the job impound garage
                pedCoords = vector4(459.0820, -1017.1157, 27.1510, 92.1553),
                storeVehicle = vector3(449.1385, -1017.2701, 28.0165),
                spawnCoords = {
                    vector4(462.2119, -1015.1483, 27.5545, 92.0322),
                    vector4(462.0640, -1019.4016, 27.5717, 91.4052),
                    vector4(446.0865, -1025.1759, 28.1097, 4.4707),
                    vector4(442.7256, -1025.6680, 28.1767, 3.2357),
                    vector4(438.7279, -1025.7568, 28.2453, 2.9294),
                    vector4(435.0581, -1026.0345, 28.3139, 1.2065),
                    vector4(431.2184, -1026.6810, 28.3892, 2.7038),
                    vector4(427.3548, -1026.9606, 28.4574, 3.2657)
                }
            }
        },
        {
            blipLabel = 'Hospital Garage',
            blipSprite = 830,
            blipColor = 1,
            jobs = {
                'ambulance'
            },
            vehiclesList = {
                { vehicle = 'ambulance', minGrade = 2 },
            },
            coords = {
                pedCoords = vector4(294.1237, -597.9418, 42.3017, 67.4052),
                storeVehicle = vector3(287.3814, -597.8590, 42.6540),
                spawnCoords = {
                    vector4(295.6890, -604.4202, 43.0926, 70.7867),
                    vector4(294.7276, -607.4980, 43.1167, 70.6208),
                    vector4(293.2164, -610.1205, 43.1302, 68.7475)
                }
            }
        }
    }
}
```

{% endtab %}

{% tab title="main.lua" %}

```lua
local config <const> = {}

config.language = 'en'

config.pedInteraction = 'target' -- 'target' or 'key'

config.interactionSettings = {
    target = {
        distance = 5.0,
        translation = {
            optionLabel = 'Open garage'
        }
    },
    key = {
        distance = 1.0,
        keyToInteract = 'E',
        translation = {
            textUIDescription = '[%s] - Garage' -- You must have the `%s` in the string, otherwise there will be an error!
        }
    }
}

config.garagePeds = {
    'a_m_y_stbla_02',
    'a_m_y_smartcaspat_01'
}

config.garagesBlip = {
    blipLabel = 'Garage',
    blipSprite = 357,
    blipScale = 0.8,
    blipColor = 5,
    blipDisplay = 2,
    asShortRange = true
}

config.storePoints = {
    markerType = 36,
    showInteractDistance = 20.0,
    showTextUIDistance = 3.0,
    color = { r = 255, g = 0, b = 0 },
    alpha = 1000.0,
    interactKey = 'E',
    textUILabel = '[%s] - To store the vehicle' -- The %s is important (it is being replaced with the interact key)
}
```

{% endtab %}

{% tab title="rent\_a\_car.lua" %}

```lua
local config <const> = {}

config.rentACar = {
    enable = true,
    finesAccount = 'bank',
    rentACarAccount = 'bank',
    cars = {
        {
            model = 'asbo',
            price = 200,
            fine_markup = 100,
            finePer10PercentDamage = 100
        },
        {
            model = 'issi2',
            price = 350,
            fine_markup = 200,
            finePer10PercentDamage = 150
        },
        {
            model = 'blista',
            price = 250,
            fine_markup = 100,
            finePer10PercentDamage = 200
        },
        {
            model = 'carbonizzare',
            price = 1000,
            fine_markup = 300,
            finePer10PercentDamage = 220
        },
        {
            model = 'comet2',
            price = 900,
            fine_markup = 300,
            finePer10PercentDamage = 300
        },
        {
            model = 'comet6',
            price = 2000,
            fine_markup = 500,
            finePer10PercentDamage = 400
        }
    }
}
```

{% endtab %}
{% endtabs %}


---

# 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://hrscripts.gitbook.io/hrscripts-documentation/resources/hrgarages.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.
