xT Docs
  • 📘Welcome
  • 🆓Free Resources
    • ⛓️Prison
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 🚶Walking Styles
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 🔧Repairs
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • ⏱️Duty Menu
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 🅿️Meter Robbery
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 👮PD Extras
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 📃Forgery
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • ⌛Cooldowns
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 🎄Christmas
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
  • 🛒Paid Resources
    • 🕴️Blackmarkets
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • ⚒️Crafting
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 🖥️Cryptomining
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 🪦Gravedigging
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 🐶Pets
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • ⛓️Prison Jobs
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 👿Slasher Minigame
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 💨Slash Tires
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 📦Storage
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
    • 🧟Zombies
      • 📝Features
      • ✅Dependencies
      • 🔌Installation & Usage
  • 🐎RedM Links
    • 🔎Natives, Discoveries, Etc
    • 🗺️Maps
    • ⚒️Developer Tools
    • 🧍Ped Models
    • 📍Blips
Powered by GitBook
On this page
  1. Paid Resources
  2. Storage

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

MySQL.scalar('SELECT `bank` FROM `nd_characters` WHERE `charid` = ? LIMIT 1', {
    owner
}, function(bankAmount)
    local newBank = (bankAmount - payment)

    MySQL.update('UPDATE `nd_characters` SET `bank` = ? WHERE `charid` = ?', {
        newBank, owner
    }, function(affectedRows)
        print(('Storage Fees Due: %s | Offline Owner: %s | Paid: %s | Old Balance: $%s | New Balance: $%s'):format(lockerID, owner, payment, bankAmount, newBank))

        MySQL.update.await('UPDATE `storagelockers` SET `lastpayment` = ?, `nextpayment` = ? WHERE `id` = ?', { currentDate, nextPayment, lockerID })
    end)
end)

ESX

MySQL.scalar('SELECT `accounts` FROM `users` WHERE `identifer` = ? 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 `users` SET `accounts` = ? WHERE `identifer` = ?', {
        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)
PreviousDependenciesNextZombies

Last updated 1 year ago

🛒
📦
🔌