mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2026-11-10 13:57:18 +01:00
* refactor: declare exports at runtime and drop the player-data provides alias Signed-off-by: Mathu-lmn <[email protected]> * refactor: pass handlers directly to RegisterNetEvent Signed-off-by: Mathu-lmn <[email protected]> * refactor: use CreateThread/Wait without the Citizen prefix Signed-off-by: Mathu-lmn <[email protected]> * chore: remove trailing whitespace, stray lines and unused locals Signed-off-by: Mathu-lmn <[email protected]> --------- Signed-off-by: Mathu-lmn <[email protected]>
28 lines
612 B
Lua
28 lines
612 B
Lua
local moneyTypes = {
|
|
cash = `MP0_WALLET_BALANCE`,
|
|
bank = `BANK_BALANCE`,
|
|
}
|
|
|
|
RegisterNetEvent('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) |