Pivity

Hook Lib

Last read Never
#1

Checkout my Hook Lib which could improve your server performance!


PRIORITIES ADDED!!

Finally found a reliable way to add/remove hooks without having problems! Also better performance!

CLICK HERE FOR MORE INFO!


PLEASE TEST THIS ON YOUR SERVER

I need server owners to test this on their servers to make sure it's ready for release and usage!

  1. Install by adding hook.lua in addons/custom_hook/lua/includes/modules/hook.lua
  2. If you are using SAM remove addons/sam/lua/includes/modules/hook.lua then install this!


Report here for any issues please! (Or make a github issue!)


Benchmarks?

Benchmarks are done using edited version of this.

Check them here.


Is it the fastest hook library?

Well, meepen's hook library is faster than mine by 20% when JIT is off and when JIT is on there is no difference, but it's not reliable and has some weird behaviors.

Yes, it's now faster than meepen's lib by 22% when jit is off.


Would this work if i have ULX/ULib on my server?

No, ULX/ULib has its own hook library and it needs it, so you need to find another admin mod. (Maybe something like SAM?)

I can add support for it now because priorities are added! (Will be adding it later when we get some tests)


Links?

Workshop

Github


Credits?

Meepen for his hook library because im using some ideas from it and inspired me to make this :D

Billy for telling me to upload this instead of making it private for my addons.

atlas for telling me to make a forum post.

Winner x 4Creative x 2Agree x 1Congratulations x 1
#2

This is a nice improvement! I'll be sure to add it to all my future scripts (Not on gmodstore of course).

I'm currently working on a Regex101 (For word filters and ingame chat commands) guide myself, hopefully it can help out the community.

Friendly x 4
#3

Thank you velkon for helping the community, we appreciate your work.

Friendly x 3
#4

Not too sure if this is a problem with the hook library but since i installed it on my server (DarkRP) the doors that jobs have access to (does not affect the door groups) just reset on server restart. Im just wondering if its a conflict between scripts or if its got nothing to do with the hook at all.

#5

Try removing the hook library?

Agree x 1Funny x 1
#6

I am just testing it again with it in as without it my doors save as they should.

#7

Seems to be working now, maybe i just broke something. Thanks anyway

Agree x 1
#8

Priorities added!

Need testers, read main post for more info!

Winner x 1
#10

Breaks some scripts with the "OnPlayerChat" hook

#11

Would be nice if you give more details

#12

Seems to break Alydus Fortification builder tablet, probably within "KeyPress", "PlayerSwitchWeapon" or "PostDrawTranslucentRenderables" hooks.

#13

Wonder when there will be ULX/ULib support

#14
This replaces gmods default hook.Add ?
Dumb x 4
Users viewing this thread
Nobody