Created
September 5, 2014 12:08
-
-
Save Python1320/4de1eebe6c549c13252a to your computer and use it in GitHub Desktop.
hook.Add callchain thingy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
H=NewChain( | |
function(chain,...) | |
if not chain[2] then | |
return hook.Run(chain[1],...) -- call hook | |
elseif chain[2] then | |
return hook.GetTable()[chain[1]][chain[2]](...) -- call single hook?? | |
end | |
end, | |
function(chain,val) | |
if isfunction(val) then | |
hook.Add(chain[1],chain[2],val) | |
else | |
hook.Remove(chain[1],chain[2]) | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment