# ESX

*This tutorial will help you disable your players to take out owned vehicles marked as rentable from the garage.*\
*If you don't manage to do it alone, please open ticket on our* [*Discord Server*](https://discord.gg/uniq-team)*.*

What you need to find is **function/event/callback** in your garage's script server side where the script is getting all owned garage vehicles (esx\_garage - **"esx\_garage:getVehiclesInParking"**).\
Inside the **function/event/callback** you will find MySQL query where all vehicles from **"owned\_vehicles"** table (usually owned\_vehicles on es\_extended) where owner = player's identifier.\
Example:

```lua
MySQL.query('SELECT * FROM `owned_vehicles` WHERE `owner` = @identifier AND `parking` = @parking AND `stored` = 1',
{
	['@identifier'] 	= xPlayer.identifier,
	['@parking']     	= parking
}, function(result)

	local vehicles = {}
	for i = 1, #result, 1 do
		table.insert(vehicles, {
			vehicle 	= json.decode(result[i].vehicle),
			plate 		= result[i].plate
		})
	end

	cb(vehicles)
end)
```

What you need to do is to inside the query selector add this code snippet:

```lua
AND rentable = 0
```

... so it shoud look like this:

```lua
MySQL.query('SELECT * FROM `owned_vehicles` WHERE `owner` = @identifier AND `parking` = @parking AND `stored` = 1 AND `rentable` = 0',
{
	['@identifier'] 	= xPlayer.identifier,
	['@parking']     	= parking
}, function(result)

	local vehicles = {}
	for i = 1, #result, 1 do
		table.insert(vehicles, {
			vehicle 	= json.decode(result[i].vehicle),
			plate 		= result[i].plate
		})
	end

	cb(vehicles)
end)
```

Do it for all query selectors.
