Removing default crosshair when people join the server?
4 replies, posted
Hello there guys.
I wanna know how do I make people remove the default gmod crosshair when they join my server.
Thanks in advanced
*Sorry for all the stupid questions I make*
[url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index689f.html[/url]
[CODE]
local function HideThings( name )
if(name == "CHudCrosshair") then
return false
end
-- We don't return anything here otherwise it will overwrite all other
-- HUDShouldDraw hooks.
end
hook.Add( "HUDShouldDraw", "HideThings", HideThings )
[/CODE]
Should still be relevant
[QUOTE=AnonTakesOver;43686822][url]http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index689f.html[/url]
[CODE]
local function HideThings( name )
if(name == "CHudCrosshair") then
return false
end
-- We don't return anything here otherwise it will overwrite all other
-- HUDShouldDraw hooks.
end
hook.Add( "HUDShouldDraw", "HideThings", HideThings )
[/CODE]
Should still be relevant[/QUOTE]
Where do I put this exactly? Sorry for my incredibly dumb question.... I'm really nub at lua.
Go to garrysmod/lua/autorun/server/ and make a lua file with any name and put the code in that lua file and restart the server.
aight man... Ill try it out.
[editline]27th January 2014[/editline]
Ok.... So this is my way of doing it and it worked..(For other users who don't know)
Create a new lua file in: garrysmod/lua/autorun(not in client or server file)
and Type in this code:
[CODE]if (CLIENT) then
local function HideThings( name )
if (name == "CHudCrosshair) then
return false
end
end
hook.Add( "HUDShouldDraw", "HideThings", HideThings )
end[/CODE]
Thanks for helping me guys! Cheers :D
Sorry, you need to Log In to post a reply to this thread.