# ESX

### es\_extended

{% stepper %}
{% step %}

#### **Add Keys (client side)**

View the code on GitHub: [ex\_extended/client/functions.lua](https://github.com/esx-framework/esx_core/blob/b3deeae1ebd6a465310857001e02b34236d97a0e/%5Bcore%5D/es_extended/client/functions.lua#L570)

Add the line of code exactly as seen in the screenshot below.

{% code title="ex\_extended/client/functions.lua — line 570" %}

```lua
TriggerEvent('cd_garage:AddKeys', exports['cd_garage']:GetPlate(vehicle))
```

{% endcode %}

<figure><img src="/files/ioSLfeh9EmMnLTo01ILm" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### **Remove Persistent Vehicles**

View the code on GitHub: [es\_extended/client/functions.lua](https://github.com/esx-framework/esx_core/blob/4ce57fc5662fc791b3dcdf73be96079e273bf61d/%5Bcore%5D/es_extended/client/functions.lua#L405)

Add the line of code exactly as seen in the screenshot below.

{% code title="es\_extended/client/functions.lua — line 23" %}

```lua
TriggerServerEvent('cd_garage:RemovePersistentVehicles', exports['cd_garage']:GetPlate(vehicle))
```

{% endcode %}

<figure><img src="/files/1LNhF1UuukCRLxJooY2m" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}

#### **Do vehicles still respawn after deleting them?**

If vehicles still respawn after being deleted, it’s likely that one of your resources does not use the ESX delete vehicle function. You will need to refer to [#PersistentVehicles](https://docs.codesign.pro/paid-scripts/garage#persistent-vehicles) and add the necessary event to that resource.
{% endhint %}
{% endstep %}
{% endstepper %}

***

### esx\_policejob

{% stepper %}
{% step %}

#### **Personal Owned Job Garage**

View the code on GitHub: [esx\_policejob/server/main.lua](https://github.com/esx-framework/ESX-Legacy-Addons/blob/973ae5390b61e3e6e6e2f507fe8d13cb8d2370af/%5Besx_addons%5D/esx_policejob/server/main.lua#L377)

REPLACE the line of code exactly as seen in the screenshot below.

{% code title="esx\_policejob/server/main.lua — line 377" %}

```sql
MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job_personalowned, `stored`) VALUES (?, ?, ?, ?, ?, ?)', { xPlayer.identifier, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true},
```

{% endcode %}

<figure><img src="/files/fRbK4aAUdyhgkiaBsItK" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### **Society Owned Job Garage**

View the code on GitHub: [esx\_policejob/server/main.lua](https://github.com/esx-framework/ESX-Legacy-Addons/blob/973ae5390b61e3e6e6e2f507fe8d13cb8d2370af/%5Besx_addons%5D/esx_policejob/server/main.lua#L377)

REPLACE the line of code exactly as seen in the screenshot below.

{% code title="esx\_policejob/server/main.lua — line 377" %}

```sql
MySQL.insert('INSERT INTO owned_vehicles (owner, vehicle, plate, type, job, `stored`) VALUES (?, ?, ?, ?, ?, ?)', { xPlayer.job.name, json.encode(vehicleProps), vehicleProps.plate, type, xPlayer.job.name, true},
```

{% endcode %}

<figure><img src="/files/YZhSj69cZGUTt3Cljf1a" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

***

### esx\_boat

{% stepper %}
{% step %}
**Update Garage Type**

View the code on GitHub: [esx\_boat/client/main.lua](https://github.com/esx-framework/ESX-Legacy-Addons/blob/973ae5390b61e3e6e6e2f507fe8d13cb8d2370af/%5Besx_addons%5D/esx_boat/client/main.lua#L122)

Add the line of code exactly as seen in the screenshot below.

{% code title="esx\_boat/client/main.lua — line 122" %}

```lua
TriggerEvent('cd_garage:UpdateGarageType')
```

{% endcode %}

<figure><img src="/files/m8hrtOaLXfzeZkH86I5G" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# 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://docs.codesign.pro/paid-scripts/garage/resource-integration/esx.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.
