Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
AfterLifeStudio authored Oct 15, 2024
1 parent 5f3d578 commit e8d466c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
18 changes: 10 additions & 8 deletions qbx_hudcomponents/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ local disableControls = config.disable.controls
local displayAmmo = config.disable.displayAmmo

CreateThread(function()

for i = 1, #disableHudComponents do
SetHudComponentSize(disableHudComponents[i],0.0,0.0)
end

while true do

for i = 1, #disableHudComponents do
HideHudComponentThisFrame(disableHudComponents[i])
end

for i = 1, #disableControls do
DisableControlAction(2, disableControls[i], true)
end

DisplayAmmoThisFrame(displayAmmo)

Wait(0)
end
end)
Expand All @@ -23,9 +22,11 @@ local function addDisableHudComponents(hudComponents)
local hudComponentsType = type(hudComponents)
if hudComponentsType == 'number' then
disableHudComponents[#disableHudComponents+1] = hudComponents
SetHudComponentSize(hudComponents,0.0,0.0)
elseif hudComponentsType == 'table' and table.type(hudComponents) == 'array' then
for i = 1, #hudComponents do
disableHudComponents[#disableHudComponents+1] = hudComponents[i]
SetHudComponentSize(hudComponents,0.0,0.0)
end
end
end
Expand All @@ -40,14 +41,15 @@ local function removeDisableHudComponents(hudComponents)
for i = 1, #disableHudComponents do
if disableHudComponents[i] == hudComponents then
table.remove(disableHudComponents, i)
ResetHudComponentValues(i)
break
end
end
elseif hudComponentsType == 'table' and table.type(hudComponents) == 'array' then
for i = 1, #disableHudComponents do
for i2 = 1, #hudComponents do
if disableHudComponents[i] == hudComponents[i2] then
table.remove(disableHudComponents, i)
ResetHudComponentValues(i)
end
end
end
Expand Down
3 changes: 0 additions & 3 deletions qbx_hudcomponents/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,5 @@ return {

-- https://docs.fivem.net/docs/game-references/controls/
controls = {37},

-- False disables ammo display
displayAmmo = true,
}
}

0 comments on commit e8d466c

Please sign in to comment.