if !SERVER then return end


local function zpizmak_IngredientChecker()
	for k, v in pairs(ents.FindByClass( "zpizmak_ingredient" ) ) do
		if(IsValid(v))then
			if(v.SpawnTime < CurTime())then
				v:DeSpawn()
			end
		end
	end
end

local function Check_IngredientChecker_TimerExist()
	if(zpizmak.config.Ingredient_Despawn > 0)then
		if timer.Exists("zpizmak_ingredientdeleter_id") == false then
			timer.Create("zpizmak_ingredientdeleter_id",30,0,zpizmak_IngredientChecker)
		end
	end
end
hook.Add( "InitPostEntity", "zpizmak_ingredientdeleter_spawn_OnMapLoad", Check_IngredientChecker_TimerExist )
