01-09-2018, 03:56 AM
That's a neat way of storing the hooks, but I'd probably use something like this instead:
Code:
local hooks = {
[cPluginManager.HOOK_TICK] = function(TimeDelta)
end
}
function Initialize(Plugin)
Plugin:SetName("SomeCoolPlugin")
Plugin:SetVersion(1)
if hooks then
for hook, callback in pairs(hooks) do
cPluginManager:AddHook(hook, callback)
end
end
return true;
end