Jump to content

Remove crosshair


Recommended Posts

Posted

SImply, hide the crosshair HUD part:

addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        showPlayerHudComponent ( source, "crosshair", false ) 
    end 
) 

Posted

Try hiding it on spawn:

addEventHandler ( "onPlayerSpawn", root, 
    function ( ) 
        showPlayerHudComponent ( source, "crosshair", false ) 
    end 
) 

Posted

Well, you can use both.

And add this to hide it when resource starts:

addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, player in ipairs ( getElementsByType ( "player" ) ) do 
            showPlayerHudComponent ( player, "crosshair", false ) 
        end 
    end 
) 

Posted
Well, you can use both.

And add this to hide it when resource starts:

addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, player in ipairs ( getElementsByType ( "player" ) ) do 
            showPlayerHudComponent ( player, "crosshair", false ) 
        end 
    end 
) 

Instead of a bunch of functions and events it may be more useful and practical to use it client-sided and onClientResourceStart ;)

Posted
Well, you can use both.

And add this to hide it when resource starts:

addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        for _, player in ipairs ( getElementsByType ( "player" ) ) do 
            showPlayerHudComponent ( player, "crosshair", false ) 
        end 
    end 
) 

Instead of a bunch of functions and events it may be more useful and practical to use it client-sided and onClientResourceStart ;)

Can be done both ways, is up to him.

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