# RHD Garage

### Installation:

1. Run SQL according to the framework you use
2. If you use QB-Phone then you have to change several codes as below

{% hint style="warning" %}
If you use QB-Phone then you have to change several codes as below
{% endhint %}

{% tabs %}
{% tab title="QB-Phone Default" %}

1. client/main.lua `line:302`&#x20;

```lua
PhoneData.GarageVehicles = exports.rhd_garage:getvehForPhone()
```

2. client/main.lua `line:860`&#x20;

```lua
RegisterNUICallback('track-vehicle', function(data, cb)
    local veh = data.veh
    local success = exports.rhd_garage:trackveh(veh.plate, veh.garage)
    if success and not veh.disableTracking then
        QBCore.Functions.Notify("Your vehicle has been marked", "success")
    else
        QBCore.Functions.Notify("This vehicle cannot be located", "error")
    end
    cb("ok")
end)
```

{% endtab %}

{% tab title="QB-Phone Renewed-Scripts" %}

1. client/garage.lua `line:21`

```lua
RegisterNUICallback('SetupGarageVehicles', function(_, cb)
    vehicles = exports.rhd_garage:getvehForPhone()
end)
```

2. client/garage.lua`line:27`&#x20;

```lua
RegisterNUICallback('gps-vehicle-garage', function(data, cb)
    local veh = data.veh
    local success = exports.rhd_garage:trackveh(veh.plate, veh.garage)
    if success and not veh.disableTracking then
        QBCore.Functions.Notify("Your vehicle has been marked", "success")
    else
        QBCore.Functions.Notify("This vehicle cannot be located", "error")
    end
    cb("ok")
end)
```

{% endtab %}
{% endtabs %}

3. Prepare the configuration in `shared/config.lua`&#x20;
4. Start the `rhd_garage` resource in `server.cfg` like the code below:

```lua
ensure ox_lib
ensure es_extended
ensure rhd_garage
```

5. Enter the game and use the `/garagelist` command to create and edit garages


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://rhd.gitbook.io/rhd-s/free-resources/rhd-garage.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.
