# 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/\[core]/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="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FNR0pR26eAVqDRWaDFi26%2Fimage.png?alt=media&#x26;token=c718daa5-17ad-4691-96ef-36295b56d112" 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/\[core]/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="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FGO92Z9GtaZqqbTvF9AFD%2FScreenshot_5.png?alt=media&#x26;token=579f6863-4395-43c0-8452-7c65cd051d38" 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/\[esx_addons]/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="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FADr1VOGVXYgkF3YhYs8D%2F7xn3nAk.png?alt=media&#x26;token=271d05e3-5551-4a03-9446-cb9aa86d3fbb" 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/\[esx_addons]/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="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FKxlYuATurNFlnif5Bs1Z%2FYPTcdhD.png?alt=media&#x26;token=bece81c5-4391-49dd-93ab-4c217f907b9a" 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/\[esx_addons]/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="https://789235289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MSKsM-AnxI2icNixJI8%2Fuploads%2FxCqEJDDvpUd6nuj68iau%2FScreenshot_3.png?alt=media&#x26;token=47f9a674-1ae7-4c5b-a35a-b62787f9ed58" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
