improvement(client/hud): Setup a proper function for clearing the hud, instead of sending multiple NUI messages

This commit is contained in:
Linden
2021-05-28 05:54:28 +10:00
parent 20fa7ae52f
commit 2cc58b6e09
2 changed files with 13 additions and 6 deletions
+3 -6
View File
@@ -142,12 +142,9 @@ ESX.UI.HUD.RemoveElement = function(name)
end
ESX.UI.HUD.Reset = function()
for i=1, #ESX.UI.HUD.RegisteredElements, 1 do
SendNUIMessage({
action = 'deleteHUDElement',
name = ESX.UI.HUD.RegisteredElements[i]
})
end
SendNUIMessage({
action = 'resetHUDElements'
})
ESX.UI.HUD.RegisteredElements = {}
end