Scripts/resources/[cfx-default]/[gameplay]/[examples]/money/client.lua
2024-12-29 20:48:41 +01:00

30 lines
652 B
Lua

local moneyTypes = {
cash = `MP0_WALLET_BALANCE`,
bank = `BANK_BALANCE`,
}
RegisterNetEvent('money:displayUpdate')
AddEventHandler('money:displayUpdate', function(type, money)
local stat = moneyTypes[type]
if not stat then return end
StatSetInt(stat, math.floor(money))
end)
TriggerServerEvent('money:requestDisplay')
CreateThread(function()
while true do
Wait(0)
if IsControlJustPressed(0, 20) then
SetMultiplayerBankCash()
SetMultiplayerWalletCash()
Wait(4350)
RemoveMultiplayerBankCash()
RemoveMultiplayerWalletCash()
end
end
end)