timed_events = {}
last_timed_event = 0

function AddTimedEvent( time, event, absolute )
	if not absolute then
		last_timed_event = last_timed_event+(time*0.5)
		table.insert( timed_events, { time = last_timed_event, event = event } )
	else
		table.insert( timed_events, { time = time, event = event } )
	end
end

function ProcessTimedEvents()
	if not timed_events then
		return
	end
	for key, value in pairs( timed_events ) do
		if local_time > value.time then
			value.event()
			table.remove( timed_events, key )
		end
	end
end

function ResetTimedEvents()
	last_timed_event = 0
	timed_events = {}
end
