Common questions and problems
Here, I'll list some things that might cause confusion regarding the config or potential issues related to those doubts.
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.
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:
Contact the creators of those scripts, or
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.
-- 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
}
}
}
How do i Mage sure work vehicles are not taxed?
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!
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:
MySQL.scalar.await: Queries the database to retrieve the model of the vehicle using the plate.
string.match: Checks if the model contains the word "police". If true, the vehicle will be considered job-owned and excluded from taxes.
return true: If the vehicle meets the condition, it returns true to exclude it from taxes.
return false: If the condition is not met, the vehicle won't be excluded from taxes.
Last updated