Jump to content

hide hud issue


5150

Recommended Posts

Posted

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 
) 

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 (edited)
  
   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
Posted

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

Multi Theft Auto : Racers Land

10%

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