

-- 	DO NOT EDIT THIS FILE!

-- When an event is called it also calls this function which allows you to hook into
-- the events without overriding the main gamemode event.
-- event hooks are called AFTER the gamemode hook.

-- To add a hook:
--
--  HookEvent( "eventPlayerSay", functionname )
--


g_EvenHooks = {}

function DoEventHook( name, ... )
	for k in g_EvenHooks do
		if g_EvenHooks[k].name == name then
			g_EvenHooks[k].func( unpack(arg) )	
		end
	end
end

function HookEvent(name, func)
	local i = 0
	while g_EvenHooks[i] do
		i = i + 1
		if g_EvenHooks[i] then
			if g_EvenHooks[i].func == func and g_EvenHooks[i].name == name then
				return
			end
		end
	end
	g_EvenHooks[i] = {}
	g_EvenHooks[i].name = name
	g_EvenHooks[i].func = func
	return i
end

function UnHookEvent(num)
	g_EvenHooks[num] = nil
end
