ULX

Author Topic: How to remove crosshair  (Read 2870 times)

0 Members and 1 Guest are viewing this topic.

Offline genkaix1000

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
How to remove crosshair
« on: January 22, 2017, 07:05:31 PM »
Hi everyone!
Anyone know how to remove the crosshair on all weapons?

(For all users of the server)

Offline BlueNova

  • Full Member
  • ***
  • Posts: 113
  • Karma: 13
  • The most powerful force in the universe.
Re: How to remove crosshair
« Reply #1 on: January 22, 2017, 07:24:33 PM »
Code: [Select]
crosshair 1 is for the crosshair on
Code: [Select]
crosshair 0 is for the crosshair off

Just put those in console.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: How to remove crosshair
« Reply #2 on: January 22, 2017, 08:01:15 PM »
That's clientside, he might want to disable it for all players.

Also, this is off-topic. Moving.

Offline genkaix1000

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: How to remove crosshair
« Reply #3 on: January 22, 2017, 08:32:45 PM »
Sorry, I was wrong about the section.
I need to remove the crosshair from all players and can not activate it

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: How to remove crosshair
« Reply #4 on: January 22, 2017, 09:06:25 PM »
Throw this in a lua file and save it to garrysmod/lua/autorun

Code: [Select]
AddCSLuaFile()
if SERVER then return end
function HideHUD(name)
for k, v in pairs( { "CHudCrosshair" } ) do
if name == v then return false end
end
end
hook.Add( "HUDShouldDraw", "HideHUD", HideHUD)


or alternatively, you could explore the use of:

http://wiki.garrysmod.com/page/Player/CrosshairDisable
« Last Edit: January 22, 2017, 09:08:07 PM by MrPresident »

Offline genkaix1000

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: How to remove crosshair
« Reply #5 on: January 23, 2017, 05:06:21 PM »
Thanks! Works fine!