Jump to content

hide hud issue


5150

Recommended Posts

whats wrong with this?

addEventHandler ( "onPlayerJoin", root,  
    function () 
        setPlayerHudComponentVisible ( source, "ammo", false )  
        setPlayerHudComponentVisible ( source, "weapon", false ) 
        setPlayerHudComponentVisible ( source, "armor", false ) 
        setPlayerHudComponentVisible ( source, "health", false ) 
        setPlayerHudComponentVisible ( source, "money", false ) 
        setPlayerHudComponentVisible ( source, "breath", false ) 
        setPlayerHudComponentVisible ( source, "clock", false ) 
        setPlayerHudComponentVisible ( source, "radar", false ) 
         
    end 
) 

Link to comment
  
   addEventHandler ( "onPlayerSpawn", root, 
function () 
        setPlayerHudComponentVisible ( source, "ammo", false ) 
        setPlayerHudComponentVisible ( source, "weapon", false ) 
        setPlayerHudComponentVisible ( source, "armor", false ) 
        setPlayerHudComponentVisible ( source, "health", false ) 
        setPlayerHudComponentVisible ( source, "money", false ) 
        setPlayerHudComponentVisible ( source, "breath", false ) 
        setPlayerHudComponentVisible ( source, "clock", false ) 
        setPlayerHudComponentVisible ( source, "radar", false ) 
        
    end 
) 
  

Problem was.. that you cannot see change.. until you reconnect.. i changed event to onPlayerSpawn.. also make sure that you put it in serverside script

Edited by Guest
Link to comment

If you start the script when you are already joined the script wont do anything because the event is "onPlayerJoin"

.This is the reason you need to reconnect to see it

  
addEventHandler("onPlayerJoin",root, 
function () 
     showPlayerHudComponent(source,"all",false) 
end 
) 
  
addEventHandler("onResourceStart",root, 
function() 
     for i,v in pairs (getElementsByType("player")) do 
            showPlayerHudComponent(v,"all",false) 
     end 
end 
) 
  

Should do the job

Link to comment

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...