Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local h = {
- hooks = {},
- };
- local null = function() end
- function h.detour(typ)
- h.hooks[typ] = {};
- local ofunc = GAMEMODE[typ] || null;
- GAMEMODE[typ] = function(self, ...)
- ofunc(self, ...);
- for k,v in next, h.hooks[typ] do
- local retable = { v(...) };
- if (retable) then return(unpack(retable)); end
- end
- end
- end
- function h.Add(typ, func)
- if(!h.hooks[typ]) then
- h.detour(typ);
- end
- h.hooks[typ][ #h.hooks[typ] + 1 ] = func;
- end
- --example:
- h.Add("Think", function() print("nice"); end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement