This modification will make it so any outstanding bill from society_cardealer will be paid at a % based on the original billing amount once per IRL day.
example: config is set to 10% - Billed someone for 100k as a cardealer - Person will pay $10k every IRL day for 10 days automatically
You can easily modify this script to add multiple businesses that giveout loans besides cardealers
- Clone this repository.
- Extract the zip.
- Change esx_finance-master to esx_finance
- Put esx_finance to your resource folder.
- Add "start esx_finance" in your "server.cfg".
- Go into esx_billing / server / main.lua
- find the following lines
if xTarget ~= nil then
MySQL.Async.execute(
'INSERT INTO billing (identifier, sender, target_type, target, label, amount) VALUES (@identifier, @sender, @target_type, @target, @label, @amount)',
{
['@identifier'] = xTarget.identifier,
['@sender'] = xPlayer.identifier,
['@target_type'] = 'society',
['@target'] = sharedAccountName,
['@label'] = label,
['@amount'] = amount
},
function(rowsChanged)
TriggerClientEvent('esx:showNotification', xTarget.source, _U('received_invoice'))
end
)
end
- Replace with this (adding originial)
if xTarget ~= nil then
MySQL.Async.execute(
'INSERT INTO billing (identifier, sender, target_type, target, label, amount, original) VALUES (@identifier, @sender, @target_type, @target, @label, @amount, @original)',
{
['@identifier'] = xTarget.identifier,
['@sender'] = xPlayer.identifier,
['@target_type'] = 'society',
['@target'] = sharedAccountName,
['@label'] = label,
['@amount'] = amount,
['@original'] = amount
},
function(rowsChanged)
TriggerClientEvent('esx:showNotification', xTarget.source, _U('received_invoice'))
end
)
end
- Last add "original" to your billing table
ALTER TABLE `billing` ADD `original` INT(11) NOT NULL ;
- es_extended
- Async
- Cron
- CryptoGenics
- Based off esx_property rent cron job