> For the complete documentation index, see [llms.txt](https://codeforge.gitbook.io/codeforge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codeforge.gitbook.io/codeforge/special-editions/taxes-system/common-questions-and-problems.md).

# 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://codeforge.gitbook.io/codeforge/special-editions/taxes-system/common-questions-and-problems.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
