LC-Development
  • 👋Welcome to HapticCode
  • 📚Library
    • 🖥️Haptic-Lib
      • 🔧 Config
      • 📙 Usage
      • 🤝Client Functions
        • Blips
        • Items
        • Notify
        • Target
        • Peds
      • 💻Server Functions
        • Items
        • Jobs
        • Money Functions
        • Notify
  • 😇Remastered Scripts
    • 🛒 LC-Businesses
      • 🎯Job Blips
      • 💼 Duty Locations
      • ❄️ Fridges
        • Fridge Shops
        • Fridge Stashs
        • Final Step
      • 📥 Trays
      • 🍔 Drink/Fryer/Grill/Pack
      • 📦Shared Employee Stash
      • 📦Private Employee Stash
      • 📦Table Stashs
      • 🪑 Chairs
      • 💃 NPC Dancers/Strippers
      • 🎧 DJ Booths
      • 💰Cash Registers
      • 🧑Custom Animations
      • 🍔Consumables
    • 🏛️LC-Cityhall
      • 📝Config
      • 💳Licenses
  • Haptic
    • 😷 Haptic-Gangs
      • 🔧 Initial Config
      • 📚 Zone Configuration
      • 💊Drug Dealing
        • 💊 Zone Based Dealing
      • 💀Death Tracker
      • 💻Exports
      • 📝 Integrations
        • 🚑 QB-AmbulanceJob
        • 💎 QB-Jewellery
        • 💵 QB-StoreRobbery
        • 💦Rcore Integration
      • 🏗️Common Issues
    • 🔫Haptic-Ammunation
      • 📝Config
    • 💊Haptic-DrugEffects
Powered by GitBook
On this page
  1. Library
  2. Haptic-Lib
  3. 💻Server Functions

Money Functions

Some money functions I made to use for a server I work for.

-- Add Cash
HapticLib.AddCash(Source, Amount, Reason)

-- Add Bank
HapticLib.AddBank(Source, Amount, Reason)

-- Add Dirty Money (You will need to modify this to work with your server)
HapticLib.AddDirtyMoney(source, amount)

--Remove Cash (Checks if they have enough first)
HapticLib.RemoveCash(source, amount, reason)

-- Remove Bank (Checks if they have enough first)
HapticLib.RemoveBank(source, amount, reason)

--Remove Dirty Money (You will need to modify this to work with your server)
HapticLib.RemoveDirtyMoney(source, amount)

function functions.RemoveDirtyMoney(source, amount)
    --Add your own Dirty Money Logic
    local Player = QBCore.Functions.GetPlayer(source)
    if Player.Functions.RemoveItem('lifecoin', amount) then
        TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items['lifecoin'], 'remove', amount)
		if Config.Debug then
			print("^2 [Haptic-Lib] - ^3 DirtMoney Removed - $ " .. amount .. " - " .. reason)
		end
        return true
    else
        return false
    end
end


-- Get Cash Balance
HapticLib.GetCashBalance(source)

-- Get Bank Balance
HapticLib.GetBankBalance(source)

-- Get Dirty Money (You have to modify it to make it work for you)
HapticLib.GetDirtyBalance(source)

-- Banking Transactions (Used for scripts that do bank transactions with statements)
-- Currently supports OkOkBanking
HapticLib.AddBankingTransaction(receiver_name, receiver_identifier, sender_name, sender_identifier, value, reason)


-- Get Society Balance (Supports okok/qb-banking you can add support yourself for whatever bank you use)
HapticLib.GetSocietyMoney(src, society)

--Add Society Money (Supports okok/qb-banking/old qb-management)
HapticLib.AddSocietyMoney(src, society, value, reason)

--Remove Society Money (Supports okok/qb-banking/old qb-management)
HapticLib.RemoveSocietyMoney(src, society, value, reason)
PreviousJobsNextNotify

Last updated 1 year ago

📚
🖥️