# RHD Garage

{% hint style="info" %}

#### Follow the garage installation method so that there are no mistakes

{% endhint %}

## Installation

***

1. #### Install the dependencys
2. #### Extract rhd\_garage into your resources
3. #### Run the SQL provided in the SQL folder

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

<details>

<summary>QB-Phone</summary>

* Original

<pre class="language-lua" data-title="client/main.lua"><code class="lang-lua"><strong>-- line 302
</strong><strong>PhoneData.GarageVehicles = exports.rhd_garage:getvehForPhone()
</strong></code></pre>

<pre class="language-lua" data-title="client/main.lua"><code class="lang-lua"><strong>-- line 860
</strong><strong>RegisterNUICallback('track-vehicle', function(data, cb)
</strong>    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)
</code></pre>

* Renewed-Scripts

{% code title="client/garage.lua" %}

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

{% endcode %}

{% code title="client/garage.lua" %}

```lua
-- line 27
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)
```

{% endcode %}

</details>

4. #### Start rhd\_garage in server.cfg
