insuranceConfig.lua
-- What is the insurance system?
-- When vehicles don't have insurance, the towing fee increases exponentially every time you take the vehicle from the impound.
config.insuranceActive = true -- Set true if you want to use the insurance system
config.insuranceLocation = {
{ coord = vector4(-941.4, -2997.3, 13.95, 60.3), ped = `s_m_y_cop_01`, maxDistance = 8, pressDistance = 4, blip = true },
{ coord = vector4(-369.37, -2464.92, 2.39, 230.66), maxDistance = 12, pressDistance = 10, blip = true },
{ coord = vector4(-823.70, -2404.07, 14.57, 263.58), ped = `s_m_y_cop_01`, maxDistance = 8, pressDistance = 4, blip = true },
{ coord = vector4(-2953.40, 56.80, 11.60, 64.75), ped = `cs_carbuyer`, maxDistance = 8, pressDistance = 4, blip = true },
{ coord = vector4(441.98, -1013.92, 28.63, 178.56), ped = `cs_carbuyer`, maxDistance = 8, pressDistance = 4, blip = false },
}
config.insuranceDay = 30 -- How many days the vehicle will be insured when the insurance is paid
config.defaultMoney = 10000 -- This is the insurance price if the vehicle is not added in the vehicleshop or in the config.customInsurancePrice setting
config.insurencePercent = 0.03 -- Insurance fee calculation (car pirce * config.insurencePercent)
-- Determines the insurance price according to Vehicle Class
config.classVehiclePrice = {
["14"] = 5000, -- Boat
["18"] = 100, -- Emergency
["15"] = 25000, -- Helicopter
["16"] = 10000, -- Plane
}
config.customInsurancePrice = { -- Set the insurance cost of vehicles from this setting instead of the vehicle fit rate * conmfig.insurencePercent
[`dilettante2`] = 100,
[`romero`] = 250,
[`newsvan`] = 250,
[`as350`] = 250,
[`polmav`] = 250,
[`nksvolitoems`] = 250,
[`newsheli`] = 250,
[`bmx`] = 200,
[`bobcatxl`] = 10000,
[`cruiser`] = 200,
[`fixter`] = 200,
[`scorcher`] = 200,
[`tribike`] = 200,
[`tribike2`] = 200,
[`tribike3`] = 200,
[`cognoscenti`] = 1000,
[`pbus2`] = 1000,
[`tourbus`] = 1000,
}
config.vehiclePrice = { -- Vehicle price list (QB auto-set)
--[`kuruma`] = 500,
}
if not IsDuplicityVersion() then
CreateThread(function()
local tgiann_vehicleshop = GetResourceState("tgiann-vehicleshop") ~= "missing"
if tgiann_vehicleshop then
Wait(1000)
local vehicleList = exports["tgiann-vehicleshop"]:GetVehicleList()
while not next(vehicleList) do
Wait(1000)
vehicleList = exports["tgiann-vehicleshop"]:GetVehicleList()
end
for _, data in pairs(vehicleList) do
local modelHash = GetHashKey(data.model)
config.vehiclePrice[modelHash] = data.price
end
elseif config.framework == "qb" then
local QBCore = tgiCore.core
for _, vehicleData in pairs(QBCore.Shared.Vehicles) do
config.vehiclePrice[joaat(vehicleData.model)] = vehicleData.price
end
end
end)
end
Last updated