πInstallation & Usage
Run the SQL on your database
Add the job (if you'd like) to your core shared jobs
Edit server functions in sv_edit.lua
Edit the config
Offline Autodraft Fees SQL
QB / QBX
MySQL.scalar('SELECT `money` FROM `players` WHERE `citizenid` = ? LIMIT 1', {
owner
}, function(money)
local moneyInfo = json.decode(money)
local newBank = (moneyInfo.bank - payment)
local newInfo = {}
for moneyType, moneyAmount in pairs(moneyInfo) do
if moneyType ~= 'bank' then
newInfo[moneyType] = moneyAmount
else
newInfo['bank'] = newBank
end
end
newInfo = json.encode(newInfo)
MySQL.update('UPDATE `players` SET `money` = ? WHERE `citizenid` = ?', {
newInfo, owner
}, function(affectedRows)
print(('Storage Fees Due: %s | Offline Owner: %s | Paid: %s | Old Balance: $%s | New Balance: $%s'):format(lockerID, owner, payment, moneyInfo.bank, newBank))
MySQL.update.await('UPDATE `storagelockers` SET `lastpayment` = ?, `nextpayment` = ? WHERE `id` = ?', { currentDate, nextPayment, lockerID })
end)
end)ND_Core
ESX
Last updated