Skip to content

Instantly share code, notes, and snippets.

@Python1320
Created September 5, 2014 12:08
Show Gist options
  • Save Python1320/4de1eebe6c549c13252a to your computer and use it in GitHub Desktop.
Save Python1320/4de1eebe6c549c13252a to your computer and use it in GitHub Desktop.
hook.Add callchain thingy
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