# Common questions and problems

<details>

<summary>I’m getting an OXMYSQL error or something related to the database, or I simply don’t know how to fill out this part of the config.</summary>

Each server will have **its own table and column names**... In this config, you'll find the **default names** for ESX and QB, but if you're using **custom scripts** like **HOUSINGS**, **GARAGES**, or any other scripts that rely on different tables, you’ll need to do the following:

1. **Contact the creators** of those scripts, or
2. **Check your database** directly to find the exact names of the tables and columns.

This way, our script will be able to correctly detect which houses and vehicles belong to your players.

```lua
-- Database Table Configuration
Config.DatabaseTables = { -- Configure with your database tables
    ESX = {
        Vehicles = {
            table = 'owned_vehicles', -- Vehicle ownership table
            ownerColumn = 'owner' -- Column that identifies the owner of the vehicle
        },
        Properties = {
            table = 'datastore_data', -- Property ownership table
            ownerColumn = 'owner'
        }
    },
    QB = {
        Vehicles = {
            table = 'player_vehicles', -- Vehicle ownership table
            ownerColumn = 'citizenid' -- Column that identifies the owner of the vehicle
        },
        Properties = {
            table = 'player_houses', -- Property ownership table
            ownerColumn = 'citizenid' -- Column that identifies the owner of the property
        }
    }
}
```

</details>

<details>

<summary>How do i Mage sure work vehicles are not taxed?</summary>

Typically, well-known garage systems store those vehicles in **separate tables in the database**, so this shouldn’t be an issue. However, just to be safe, we’ve added an **open function** in `server/open.lua` that allows you to create a **custom function** to handle this.

Here’s a simple example of what you can create, but please note, **it will be your responsibility** to implement it!

```lua
function IsVehicleJobOwned(plate)
    -- Get the vehicle model using the plate number
    local result = MySQL.scalar.await('SELECT model FROM owned_vehicles WHERE plate = ?', {plate})
    
    -- If the model includes "police", exclude the vehicle from taxes
    if result and string.match(result, "police") then
        return true -- The vehicle is job-owned, so exclude it from taxes
    end

    return false -- If it's not a job-owned vehicle, do not exclude it
end
```

#### Explanation:

1. **MySQL.scalar.await**: Queries the database to retrieve the model of the vehicle using the plate.
2. **string.match**: Checks if the model contains the word "police". If true, the vehicle will be considered job-owned and excluded from taxes.
3. **return true**: If the vehicle meets the condition, it returns true to exclude it from taxes.
4. **return false**: If the condition is not met, the vehicle won't be excluded from taxes.

</details>
