Studio PLAYERS
  • Studio PLAYERS
  • 📦QB/QBX SCRIPTS
    • 💸SA-MONEY
      • 💡Introduction
      • ⚙️Installation
        • ⚙️Installation
        • ⚙️Migration
        • ⚙️Add new currency
      • 🗃️Displays $ in inventory
      • 📚HUD Implementations
        • 📗17mov_Hud
        • 📗wais-hudv5
    • 💰SA-MONEYWASH
      • 💡Introduction
      • ⚙️Installation
    • 🕐SA-PLAYTIME
      • 💡Introduction
      • ⚙️Installation
      • ✈️Exports
    • ☠️SA-CHARACTERKILL
      • 💡Introduction
      • ⚙️Installation
    • 🧊SA-BOXE
      • 💡Introduction
      • 💡Usage
      • ⚙️Installation
    • 🚦SA-TRAFFICLIGHTSPRIORITY
      • 💡Introduction
      • ⚙️Installation
  • 📦ESX SCRIPTS
    • 🕐SA-PLAYTIME
      • 💡Introduction
      • ⚙️Installation
      • ✈️Exports
    • ☠️SA-CHARACTERKILL
      • 💡Introduction
      • ⚙️Installation
    • 🚦SA-TRAFFICLIGHTSPRIORITY
      • 💡Introduction
      • ⚙️Installation
  • 🛠️FAQ
    • 🛠️General Issues
    • 🛠️SA-Money-V2
Powered by GitBook
On this page
  1. QB/QBX SCRIPTS
  2. SA-MONEY
  3. HUD Implementations

17mov_Hud

This page describes how to fix issues with updating money.

Last updated 1 year ago

  • To fix the problem with updating money use this snippet.

  • Add this snippet into 17mov_Hud/client/handlers.lua

  • Here is a link to an example of the and how it should look.

📦
💸
📚
📗
full file
https://github.com/Studio-PLAYERS/TEBEX-Doc/blob/main/SA-Money/HUD-Implementations/17mov_Hud/snippet.lua
local function updateMoney()

    local PlayerData = Core.Functions.GetPlayerData()

    local newCash = PlayerData.money['cash']

    local cashIncome = newCash - MyStatus.Cash

    if cashIncome ~= 0 then

        local formatted = FormatMoney(cashIncome, true)



        SendNUIMessage({

            action = "CashTransaction",

            value = formatted

        })

        MyStatus.Cash = newCash

    end

end



RegisterNetEvent("QBCore:Client:OnPlayerLoaded", function()

    CreateThread(function()

        Wait(2000)

        while true do

            Wait(1000)

            updateMoney()

        end

    end)

end)



AddEventHandler('onResourceStart', function(resourceName)

    CreateThread(function()

        Wait(2000)

        while true do

            Wait(1000)

            updateMoney()

        end

    end)

end)