sc_cartax

ESX ESX QBCore QBCore

This FiveM script was developed to regularly deduct insurance fees from players for their vehicles. Due to the various configuration options in the Config.lua file, the insurance obligation can be customized in detail. This contributes to a more realistic gaming experience and provides an additional challenge when dealing with vehicles.

Replace

If you want to use your own billing system you have to change the following:

Search for line 24 in sc_cartax/server/server.lua

Example: replace line 24 with the myBills call shown below:

TriggerEvent('myBills:gotAnswerForBill', xPlayer.source, xPlayer.source, 'society_police', 'Car Taxes', ESX.Math.Round(tax), true, true)
if carCount > 0 then
local tax = carCount * taxMultiplier
if xPlayer ~= nil then
    xPlayer.removeAccountMoney('bank', ESX.Math.Round(tax))
    for _, notifyModule in ipairs(Config.Notify) do
        if notifyModule.enabled then
            local notificationText = Translation[Config.Locale]['text'] .. tax .. Translation[Config.Locale]['text1']
            
            if notifyModule.name == "ox_lib" then
                notificationText = removeColorCodes(notificationText)
            end

            if notifyModule.name == "bulletin" then
                TriggerClientEvent('bulletin:sendAdvanced')
            elseif notifyModule.name == "default" then
                TriggerClientEvent('cartax:picturemsg', xPlayer.source, Config.Char, notificationText, Config.Name, Translation[Config.Locale]['pay_text'])
            elseif notifyModule.name == "ox_lib" then
                TriggerClientEvent('ox_lib:notify', xPlayer.source, {
                    title = Translation[Config.Locale]['pay_text'],
                    description = notificationText,
                    duration = 5000,
                    icon = 'car'
                })
            end
        end
    end
end