Author Topic: Hooking with "noclip"  (Read 2316 times)

0 Members and 2 Guests are viewing this topic.

Offline Fleamonji

  • Newbie
  • *
  • Posts: 45
  • Karma: 0
Hooking with "noclip"
« on: March 26, 2011, 06:37:51 AM »
I was looking at the code for noclip, but I can't seem to figure out how I would allow admins to just use the "noclip" command, instead of "ulx noclip" or "!noclip"

Offline Aaron113

  • Hero Member
  • *****
  • Posts: 803
  • Karma: 102
Re: Hooking with "noclip"
« Reply #1 on: March 26, 2011, 06:54:46 AM »
Gamemode.PlayerNoClip

Just do something simple like if ply:IsAdmin() then.

I'm assuming you have noclip disabled and your Admins use ulx noclip?

Offline Fleamonji

  • Newbie
  • *
  • Posts: 45
  • Karma: 0
Re: Hooking with "noclip"
« Reply #2 on: March 26, 2011, 07:31:44 AM »
Gamemode.PlayerNoClip

Just do something simple like if ply:IsAdmin() then.

I'm assuming you have noclip disabled and your Admins use ulx noclip?

I have that now, but some admins are too dumb to have noclip privileges.  I'm using Evolve now, but I'm ready to switch.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Hooking with "noclip"
« Reply #3 on: March 26, 2011, 08:30:23 AM »
With ULX, you could create a AdminNoNoclip group, allow all the same ulx permissions as admin, except for the ulx noclip, and change the test to return true if they aren't an AdminNoNoclip
return !ply:IsUserGroup("AdminNoNoclip")

(Though, I could have sworn returning anything such as false breaks a hook for all others. Yet, the wiki says a boolean is returned...team, has this changed or is it different for this hook?)
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming