Jump to content

hide hud


5150

Recommended Posts

Posted

i have this script for hiding huds but when i respawn, the hud appears again. whats wrong?

local hudTable = 
{ 
"radar", 
"ammo", 
"weapon", 
"area_name", 
"wanted", 
"money", 
"health", 
"clock", 
"vehicle_name" 
} 
  
addEventHandler("onClientResourceStart", resourceRoot, 
    function() 
    for id, hudComponents in ipairs(hudTable) do 
        showPlayerHudComponent(hudComponents, false) 
    end 
    end 
) 
  
addEventHandler("onClientResourceStop", resourceRoot, 
    function() 
    for id, hudComponents in ipairs(hudTable) do 
        showPlayerHudComponent(hudComponents, true) 
    end 
    end 
) 

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted
local hudTable = 
{ 
"radar", 
"ammo", 
"weapon", 
"area_name", 
"wanted", 
"money", 
"health", 
"clock", 
"vehicle_name" 
} 
  
function hideHUD(enable) 
     for _, hud in ipairs(hudTable) do 
          showPlayerHudComponent(hud, enable) 
     end 
end 
  
addEventHandler("onClientResourceStart", resourceRoot, function() 
     hideHUD(false) 
end) 
  
addEventHandler("onClientPlayerSpawn", getLocalPlayer(), function() 
     hideHUD(false) 
end) 
  
addEventHandler("onClientResourceStop", resourceRoot, function() 
     hideHUD(true) 
end) 

Posted

it still shows the hud after you respawn :/

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted
    local hudTable = 
    { 
    "radar", 
    "ammo", 
    "weapon", 
    "area_name", 
    "wanted", 
    "money", 
    "health", 
    "clock", 
    "vehicle_name" 
    } 
      
    function hideHUD(enable) 
         for _, hud in ipairs(hudTable) do 
              showPlayerHudComponent(hud, enable) 
         end 
    end 
      
    addEventHandler("onClientResourceStart", resourceRoot, function() 
         hideHUD(false) 
    end) 
      
    addEventHandler("onClientPlayerSpawn", getLocalPlayer(), function() 
        setTimer ( hideHUD, 2000, 1, false ) 
    end) 
      
    addEventHandler("onClientResourceStop", resourceRoot, function() 
         hideHUD(true) 
    end) 

Adds that small delay needed for the client to utilize the hud and stuff.

Wolf Inc Discord

Youtube channel
Github

Posted

works, thanks :) i shortened the time to 500 so its not there for so long. maybe you can take a look at the topic i just posted? got a complicated issue

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Posted

sorry to crap in your cornflakes but the hud will stay hidden, then about 5 minutes later the radar will come back. but only the radar :/

Paid Roleplay Mapper/Server Management - Message on forums or Discord for info

Fluent with Owlgaming Code. Discord message for paid full set-ups and help

My Discord: 5150#5150 (or .5150)

 

Monky Gaming Roleplay/Adventure Discord 
(English players and servers interested in collaborating or partnering message me)

https://discord.gg/SFBUHknpxy

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...