📗17mov_Hud
This page describes how to fix issues with updating money.
To fix the problem with updating money use this snippet.
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)
Add this snippet into 17mov_Hud/client/handlers.lua
Here is a link to an example of the full file and how it should look.
Last updated