I got a problem with my HUD it doesn’t show the Player’s money just a message like “refresh” same with the id shows -1
Code:
local ESX = nil
local stage = 1
local micmuted = false
local voicelevel = 0
Citizen.CreateThread(function()
while ESX == nil do
TriggerEvent('esx:getShburasi45aredObjburasi45ect', function(obj) ESX = obj end)
Citizen.Wait(0)
end
TriggerEvent('esx:setMoneyDisplay', 0.0)
ESX.UI.HUD.SetDisplay(0.0)
ESX.PlayerData = ESX.GetPlayerData()
Wait(1000)
StartShowHudThread()
end)
function GetMoney(type)
for k,v in pairs(ESX.PlayerData.accounts) do
if v.name == type then
return v.money
end
end
end
function StartShowHudThread()
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
ESX.PlayerData.accounts = ESX.GetPlayerData().accounts
SendNUIMessage({
type = "update",
id = GetPlayerServerId(PlayerId()),
money = GetMoney("money"),
bank = GetMoney("bank"),
black_money = GetMoney("black_money")
})
SendNUIMessage({action = "muted", muted = micmuted})
end
end)
end
-- Salty Stuff ma boy
AddEventHandler('■■■■■■■■■_MicStateChanged', function(isMicrophoneMuted)
micmuted = isMicrophoneMuted
if micmuted == false then
SendNUIMessage({action = "nomuted"})
SendNUIMessage({action = "setVoiceLevel", level = voicelevel})
end
end)
AddEventHandler('■■■■■■■■■_VoiceRangeChanged', function(voiceRange , index , availableVoiceRanges)
print(voiceRange)
if voiceRange == 3.5 then
SendNUIMessage({action = "setVoiceLevel", level = 1})
TriggerEvent('alemaniiio_notify', '#ff0000', "■■■■■■■■■", 'Sprachreichweite: 3M')
voicelevel = 1
end
if voiceRange == 8.0 then
SendNUIMessage({action = "setVoiceLevel", level = 2})
TriggerEvent('alemaniiio_notify', '#ff0000', "■■■■■■■■■", 'Sprachreichweite: 8M')
voicelevel = 2
end
if voiceRange == 15.0 then
SendNUIMessage({action = "setVoiceLevel", level = 3})
TriggerEvent('alemaniiio_notify', '#ff0000', "■■■■■■■■■", 'Sprachreichweite: 15M')
voicelevel = 3
end
if voiceRange == 32.0 then
SendNUIMessage({action = "setVoiceLevel", level = 4})
voicelevel = 4
end
end)
RegisterNetEvent('hud:range')
AddEventHandler('hud:range', function(voiceRange)
print(voiceRange)
if micmuted == false then
end
end)
Citizen.CreateThread(function()
while true do
Citizen.Wait(1000)
local data = exports.■■■■■■■■■:GetRadioChannel(true)
if data == nil or data == '' then
SendNUIMessage({action = "hide"})
else
SendNUIMessage({action = "show"})
end
end
end)
type or paste code here